Watch the Survivor online guitar lesson by Jeff McErlain from Essentials: Chord Tone Soloing
A few notes about the solo: Notice how my main melodic line is descending going down from G-F-E-Eb-D. If you look carefully, you'll see that all of these notes are contained in the chord that I'm playing them on.
I've been calling this chord tone soloing, but it's also called voice leading. That is when we use chord tones to create a melody using the closest note, or staying on a particular note that moves through the chord changes. The more you think about this intellectually, the more you'll see it in your playing. But make no mistake, you must practice this very slowly with intent. You may or not realize it, but you've probably already been doing it here and there because it just sounds right. It's important to analyze your chord changes to see the melodic possibilities within each of them. Any way you can do this is A-OK with me, often times I'll just write out the names of the notes in each chord and see which notes are in common and which notes move by the least amount. I guarantee you'll find a melody in there!