Chord tones = melodic
Scales = get you from 'here to there'
"in notes" = chord tones (primarily) and notes within the key signature: These are 'safe' and always sound 'right'
"out notes (accidentals)" = notes not in current chord or key: These are less 'safe' and, if used well, make what your playing sound interesting and unique.
All = valid.
Study melodies. Vocal melodies are a great source. When you improvise, you need to think 'lyrically and melodically'. The bass typically is a melodic instrument providing counter-point to the main melody. Since the bass typically utilizes roots and fifths to anchor the chords for the ensemble you can assume that the instruments providing the melody are not gravitating to the roots (the bass tends to have that covered) - so melodies tend to leverage 3rds and 7ths which sound VERY melodic. Dodge 4ths, but remember, there's no such thing as a 'bad note' and if you hit a 'clinker', try hitting it again, and again - a lot of times that creates a statement that's very interesting.
So - when it comes to improvising (soloing), take the chord you're on and try simply beginning your phrase from the 3rd and see where it 'leads' you. If you are thinking in terms of being melodic - your ear should start to hear where the melody wants to go - and follow it.
Start slow - keep it simple - think melodically. Even better, if there is a clearly defined melody to the song at hand, quote it directly - then expand on it. If you are following another musician's solo, listen to what they did and see if you can 'answer' them by playing something similar.
Ultimately soloing has become synonymous with "showing off" or "being flashy" - and while both can be part of a solo, neither are necessary and moreover, both are very subjective. One thing that is not subjective is being melodic. No one can argue that if you use the chord tones (approach notes and passing tones) and phrasing that emulates a vocal melody that you're not being melodic.
Simple melodic statements will resonate with people far more than blurs of almost incoherent notes - so focus on creating simple, clear melodic statements. Follow them where the logically lead and the flash and dazzle will almost naturally find it's way in to what your doing.
Repetition is a VERY GOOD THING. If you hit a really nice statement, do it again - and again. Build off of it. Evolve it into new statements that you will then repeat.
A good solos with have a lot of really strong, clear statements that are tied together with things like scalar passages and arpeggios, slides - connectors.
Focus on melody, phrasing and clarity. Let the crazy stuff happen as a by-product. Oh, and of course, the more you practice and get your fingers able to answer what your mind comes up with, the better.