Flex is defined as the degree of a shaft's resistance to bending. The purpose of the shaft is to transfer energy from the player to the ball in the most efficient manner possible. Because players have different swing speeds and tempos shafts are manufactured in various flexes, materials and weights.
Generally the shaft flex is designated with a letter displayed on the shaft. Below are the most commonly used letters and the respective flex.
L - Ladies
A - Senior
R - Regular
S - Stiff
X - Extra Stiff
A competent club fitter will observe your swing and tempo, and with the use of a launch monitor measure your clubhead speed to determine the best possible shaft for you.
Using a shaft that is too stiff for your swing speed will cause the ball to go a shorter distance with a lower trajectory, and generally flies right of your target. Using a shaft that is too flexible usually feels solid, but causes a shot that draws or hooks with a higher than normal trajectory.
It is important to note that flex ranges can vary between manufacturers so that one company's stiff could be another company's regular. Also keep in mind that steel shafts are generally firmer than graphite shafts of the same flex designation. Because there is no universal standard it is best to try a variety of shafts to experience the "feel" of each. This trial and error method with a competent club fitter is the best way to determine the right shaft for you.