Exercise induced headaches are pretty common across a broad spectrum of ages and activities, including sex. Exertional Headaches, associated with heavy lifting, sprinting, and a rise in systolic blood pressure, are believed to be vascular or migrainous. Effort induced headaches, associated with distance related activites, are of unknown origin. They can be vascular, but like most form of stress headaches, their true etiology is unknown. They are fairly common, and as Swampy suggests, given the pain that is associated with effort exercise in any event, they are often considered the least of our problems. Tonyzackary's recomendation of NSAIDs like Ibuprofren before exercise often works as a preventitive aid (I have seen recomendations as high as 600 mg of Ibuoprofen before a ride, which seems a bit much, but you might start out with lower dosages first, i.e. 200 mg).
If NSAIDs are not reducing the frequency and intensity of these headaches -- headaches are so common and attributable to so many issues that it is impractical to discuss them in terms of eliminating headaches-- or the headaches are of an unusual presentation, i.e. focal or severe, you should see a doctor to eliminate the chance that it is related to a more serious medical condition (rare).
This also assumes that you have eliminated all the other potential causes of headaches including dehydration and poor nutrition.
google "Exercise Induced Headaches" and you will get lots of info from lots of sources about this issue. Based upon the reports, it is a very common issue.