There are basically two main approaches to improvisational soloing. The first way, and probably the easier of the two, is to figure out what key your song is in and play that scale. For instance, if your song is in C major, you play a solo using notes from a C major scale. If your song is in D minor, you use a D minor scale for your solo. You can also use variations of these scales, such as pentatonic or hexatonic, but the concept is the same.
The second approach is to treat each chord in the progression seperately and play a different scale for each chord. For instance, if your progression goes C, F, G, you would play a C major scale over the C chord, and F major scale over the F chord, and a G major scale over the G chord. (Actually, you would probably use lydian mode over the F chord and mixolydian mode over the G chord, but that's a little advanced for this post.)
What this means is to get really good at improving, you're going to need to learn a bunch of different scales, modes, arpeggios, etc. The good news is, you don't have to know all of that before you ever start to improv. You can always get by on what you know and just keep adding to your knowledge, adding more tricks and techniques as you go.
Here is where most everybody starts (and many stop): the pentatonic scale.
E-----|--X-|----|----|--X-|----
B-----|--X-|----|----|--X-|----
G-----|--X-|----|--X-|----|----
D-----|--X-|----|--X-|----|----
A-----|--X-|----|--X-|----|----
E-----|--X-|----|----|--X-|----
5th 7th
fret fret
Here's the dandy thing about this scale. In the position shown, you can play this scale over any progression in Cmaj or Amin, and all the notes will sound ok. Some will sound better than others, but none will sound just downright wrong and nasty. This scale uses four frets, and you, very conveniently, have four fingers on your left hand. Position your hand so that you have one finger behind each fret. (i.e. your index finger plays notes behind the 5th fret, your middle finger plays notes behind the 6th fret, ring finger behind the 7th, pinky behind the 8th.) If you are doing this correctly, you will not use your middle finger while playing this scale.
You can also transpose this scale to play in other keys. It's easy to do, but it's difficult to explain. If you have questions, you can email me. Here's how it works. This scale can be used as a major scale or as a minor scale. As it is shown in the diagram, it can be either a Cmaj pentatonic or an Amin pentatonic. The difference is in which note you think of as the "root" note. (In case the term "root" is new to you, here's how it works. The root of an E chord or E scale is E. The root of a C chord or C scale is C. The root of an A chord or A scale is A. Pretty easy, eh?....um...Sorry about that...) Anyway, if you think of the note on the 5th fret as the root, you're playing A minor pentatonic. If you think of the note on the 8th fret as the root, you're playing C major pentatonic.
*Transposing the minor pentatonic scale*
Let's say you want to play a D minor pentatonic scale. What you would do it put your index finger behind the 10th fret on the low E string. Now play this scale pattern just like you always do, just treating the 10th fret as if it were the 5th. What I mean is you move the whole pattern up to the 10th fret. You don't just play the D at the 10th fret, then go back to fret 5 to play the rest of the scale. I hope that makes sense.
*Transposing the major pentatonic scale*
Let's say you want to play a D major pentatonic scale. The root will be behind the 10th fret on the low E string, just like it was for the D minor pentatonic scale. However, instead of playing the note with the index finger, you play it with the pinky. That puts your index finger behind the 7th fret. Play the scale just like you normally would, just treat the 10th fret as if it were the 8th fret, and the 7th as if it were the 10th. Another way to think about it would be to look at the diagram above and replace the words "5th fret" and "7th fret" with "7th fret" and "9th fret".
When playing this scale, think of your index finger as the "minor scale" finger and your pinky as the "major scale" finger. To play a major pentatonic scale, play the root note with your pinky. To play the minor scale pattern, play the root note with your index finger.