Blues Improvisation
For melodies and lead lines, there are these basic sets of notes that can be used: scale tones, chord tones, and accidentals. For blues it sounds best-for-blues to only use notes from the blues scale, which for the notes of the key for the associated major scale is: 1 b3 4 b5 5 b7 1.
The blues scale, from the major scale's point of view, consists of scale tones (1, 4, 5), accidentals (b3, b5, b7), and chord tones that include all scale tones except the b5 when you consider the typical use of 7th chords. But, there are chord tones that are not part of the blues scale, and these should not be used if you're going for a true bluesy sound, except as passing or other non-structural tones.
For example, for the key of C the I, IV, V 7th chords are: C7) C, E, G, Bb; F7) F, A, C, Eb; G7) G, B, D, F.
For the I chord, C, the 3rd E is not in the blues scale, and is the non-bluesiest (™) note there is. Similarly the IV chord, F, has an A, which is the 6th in C, and generally not useful for blues. For the V chord, G7, neither the 3rd nor the 5th are in the blues scale, being the major scale's major 7th, the 2nd non-bluesiest note, and the 2nd, in the same class as the 6th.
A skilled player can make a lot of things work (which is very useful for fixing mistakes..), but unless you're going for an exception, focus your note selection for melody, lead, licks, and riffs on the notes in the blues scale for the key being played. Do not switch keys or add non-blues-scale chord tones when the chord changes. This is a mistake I made for a long time. Your note selection should consistently be from the blues scale of the key in which everyone (hopefully) is playing.
Just my experience.