The surprising number of Mt. Gretna residents who have consulted me for this symptom has led me to consider several hypotheses: the ~1,600 denizens of this community have, 1) more headaches than average, 2) more accessible neurologists per capita than average (~1/1600, formerly 2/1600), or, my favorite, 3) more orgasms than average.
But the good news is that the vast majority of such headaches, also pompously called "orgasmic cephalgia," "sex headache," and, most unromantically, "headache associated with sexual activity," are indeed benign, more frightening than symptomatic of serious conditions. Though medical science has not found their cause (or the cause of migraine for that matter), experience teaches us several other things: headaches that coincide with orgasm are infrequent, both among populations and even among those unfortunate enough to have had them on occasion. They usually last minutes to hours, occasionally a few days, and are more often reported by people who have had a life-long migraine tendency, especially if it comes with exertion, and by men. They tend to eventually disappear after a small number of appearances.
So, if your headache totally subsides in hours, there is probably little cause for alarm. As headache-free weeks and months pass, the headache is even less likely to be serious.
No systematic trials guide treatment. Not surprisingly, the usual over-the-counter pain remedies rarely help, though claims have been made for most of them. Only if such headaches linger or happen with increasing frequency do you need to call your doctor and anticipate an MRI. Of course, the "worst headache" of your life, under any circumstances, especially if associated with other symptoms like vomiting--or if you are someone for whom headache is a very rare experience--should get you to the Emergency room.
For more information see, Neurology 2003;61;796-800. For a general overview of migraine read Oliver Sacks' Migraine, revised and expanded in 1992. Sacks believes migraine is a "spiritual" condition. He describes the case of an aspiring priest for whom migraine with orgasm seemed to be penance for the indiscretion of his sexual contacts. Note that better migraine treatment, the triptan family of drugs, has been developed since that writing.