Naturally, the body produces a chemical called adenosine that is responsible for the sleep-wake cycle. Adenosine binds to the receptors the of the brain, causing vasodilation of the blood in the brain which increases the chance of getting a headache. Caffeine on the hand, inhibits adenosine. It binds to the same receptors of adenosine and causes a different action to happen. Caffeine causes vasoconstriction of blood vessels in the brain, slowing down the flow of blood in the brain, relieving the pain from the headache.
Caffeine is commonly found in coffee, tea, and chocolate. It is commonly extracted from coffee and cocoa beans and is added to common medications to relieve headaches. In fact, caffeine additives to pain relievers increases the performance of the drug up to 40%.
1) Bayer
2) Excedrin
3) Midol
So while I'm being careful with my caffeine in take, atleast I have a positive piece of information behind my normal morning cup of coffee...or 2 to 3 more cups :)