If your headaches follow that pattern and a CT or MRI scan shows nothing wrong, you may be able to avoid trouble by taking a breather when you suspect an impending attack or by skipping sex during susceptible times. The prescription drug propranolol (Inderal) can usually prevent sex headaches, but it can also diminish potency or impair orgasm. Some people are helped by migraine medications.