Caffeine is great for relieving headaches. I used to use it to that effect all the time, and found myself always having a headache if I wasn't hopped up on the stuff. Here's a credible link on the subject:
http://www.newscientist.com/article.ns?id=dn1491