When you play any riff or melody on a 12 bar Blues progression, your notes are fitting in with a specific set of chords which can be played by a guitar (or keyboard). The chords most commonly played in Blues are built on the first, fourth and fifth notes of the key you are playing in.
These chords are often described by the use of roman numerals. If you are playing in the key of G, these chords will be G (1), C(4) and D(5).
Sometimes you may see other types of chord symbols such as G7 (seventh chord) or G9 (ninth chord). These are other types of chords which are common in Blues. The number in the chord symbol describes the type of chord but does not affect the position of the chord in the key. For example, any chord starting with the letter G will be chord 1 in the key of G regardless of whether the chord is G, G7 or G9.
Understanding this system of numbering chords is particularly useful for learning how to play melodies which follow the 12 bar Blues structure and sound good with any accompaniment. The diagram below shows the typical positions of chords 1 4 and 5 within the 12 bar form. The 4 chord in the second bar is optional. When this chord is used, it is often called a "Quick 4". It is a good idea to memorize the progression shown below, so you will always know what chord you are playing over. When you think you know the progression well, give yourself a quiz, e.g. what chord is in bar six? (4), bar nine? (5), bar three? (1), etc.