Headache with sex

So me and hubby are going at it hot and heavy and as I have an orgasm massive almost debilitating headache comes on. Thinking maybe I could get rid of the lingering headache today we had sex again and as the orgasm hit the headache came back full speed. Any ideas of what could be causing it?! Im desperate to find an answer. Thanks