Caffeine constricts blood vessels, even in the brain. When you make it a habit, your body works extra hard to open them up -- the brain needs oxygen and nutrients, and its wastes carried away. When you take that caffeine away, your body still anticipates its arrival -- those blood vessels open up wide and put pressure on your brain.
In order to cut back (which is good if your intake is over about 200mg/day), you have to go easy. Try green tea in the same quantity as you drank coffee -- you'll cut your caffeine by about 60%.
If you're drinking diet soda with aspartame (NutraSweet, Equal, et al.) in it, stop that right now. That crap is poison. It can cause headeaches, which is actually the least of the damage it does to a body.