Watch the The Safety Net Approach online guitar lesson by Brad Carlton from Guitar Lab: The Imaj7 VIIm7 Progression
If you know how to play the chords to a piece of music, you have a framework from which to play melodies by simply playing any of the notes out of the chord voicings. This is what I term "the safety net approach", which is especially effective when you have to play over fast chord changes in which the duration of each chord is very short. This also provides for a reference point on the fingerboard, because remember, you are presented with the chord first and then you solo over it. In other words, make sure that you can play rhythm guitar with confidence and that you can see the voicings on the fingerboard without linking the notes to specific fingerings.