You could be having exercise headaches, also called exertional headaches, brought on by your workout. Some of these headaches can also occur after coughing, sneezing, sexual intercourse and straining with bowel movements. Exercise headaches are most likely to develop when you're exercising in hot, humid weather or at high altitude. A history of migraine headaches (either personally or within your family) can put you at risk for them.
No one knows what causes this malady. One theory holds that strenuous exercise dilates blood vessels in the skull. Another school of thought is that heavy weightlifting can cause spasms in the upper body and neck that bring on headaches and other unpleasant symptoms. In people with migraines, exercise often can relieve or prevent headaches, but in some cases, it can trigger them.
I would recommend seeing your doctor if your headaches come on suddenly when you exercise, if they get worse over time, if you develop numbness and tingling in your arms and legs or visual disturbances, or if the headaches began after age 50. Exercise headaches can be caused by underlying, undiagnosed medical problems ranging from sinus trouble to heart disease and (rarely) brain tumors. Serious conditions can usually be ruled out quickly with a physical exam or MRI.
Exercise headaches can often be treated or prevented with the prescription anti-inflammatory drug indomethacin. The blood pressure drug propranolol may be prescribed for you to take before your workout or on a daily basis if you get frequent episodes. Aspirin taken before physical activity may help, as well.
Warming up before exercise may prevent the problem. And make sure that you're not just dehydrated. Drink a healthy sports drink, one without artificial color or other bad ingredients, or drink water and eat a banana before your workout to prevent dehydration or an electrolyte imbalance.
Andrew Weil, M.D.