A study from Toledo, Spain shows that giving caffeine to dehydrated bicycle racers helps them ride faster, longer and with more power in hot weather (Medicine and Science in Sports and Exercise, July 2008). When combined with water and carbohydrates, caffeine ingestion increases the force of muscular contractions which helps them to pedal with more power. Almost all professional bicycle riders take caffeine is some form because they know it helps them to ride faster.
Another recent study from the University of Illinois, Urbana-Champaign shows that caffeine helps to reduce muscle pain in riders pedaling as hard and as long as they can (International Journal of Sport Nutrition and Exercise Metabolism, May 2008). Other studies have shown that caffeine is a diuretic only when a person is at rest, not during exercise.
These reported benefits of caffeine for cyclists can be expected to apply to other sports as well. However, people with heart damage should be cautious about taking caffeine before exercising. It is a stimulant and may increase risk of irregular heart beats.