Playing Over a Chord Progression
The first thing you must do to play over a chord progression is to know what key you are in. If some one is playing a chord progression of I-IV-V and the I chord is C Major, then you are in the key of C (the I chord determines the key if the I chord were D major then you would be in the key of D).
Next, Find a pattern for the major scale of the key you are in (ex. C major scale for the key of C)
Now to put it simply, all you have to do is use that scale and be creative. You will never strike a bad note while you use this method.
Advanced Stuff (using modes):
Look at chart 1 & 2. Notice that the II degree represents the Dorian mode and that the II degree represents the note D. In other words the first note of the Dorian Mode in the Key of C is the note D. So you can solo with the D Dorian Mode over a chord progression in the key of C. Why is this you ask. I'll tell you. It is because the notes in D Dorian are also the notes of C major, just in a different order. The same is true for the rest of the modes.
The big question: Why use modes?
Modes have a distinct quality when used with the chords that are
designated to them