I agree with the guy above. A lot of people blame sulfites, but I think that a lot of that is just an advertising ploy for organic (no added sulfites) wine. In reality, the headache is either caused by dehydration or an allergy to the tannins in the wine which contain histamines. Sulfites are a biproduct of fermentation. They are often added to wine to keep it from turning into vinegar.
The sulfites, which are in both red and white wines, do not give people a headache, it is the histamines in the tannins that cause the headache. I actually found this out when I took a tour of a local winery/vineyard and they suggested taking an anti-histamine such as benadryl before drinking wine to prevent a headache.