this might seem kind of obvious, but are you skipping your normal caffeinated drinks prior to or during riding? this issue came up on the velogirls list, and it emerged that the headache-afflicted woman was skipping her normal morning latte prior to riding because she thought it was too heavy to consume before exercising. Then she got massive caffeine deprivation headaches after a couple of hours of riding. Apparently others have observed this phenomenon when they went for long rides w/ no caffeine when they normally suck down coffee/diet coke all day long.

personally, I get bad headaches from squinting in the sunlight and dehydration also seems to trigger my migraines (as noted by others above).