Question: what are the causes of headaches

Reference:
 Sex headaches Overview Sex headaches are brought on by sexual activity - especially an orgasm. You may notice a dull ache in your head and neck that builds up as sexual excitement increases. Or, more commonly, you may experience a sudden, severe headache just before or during orgasm. Most sex headaches are nothing to worry about. But some can be a sign of something serious, such as problems with the blood vessels that feed your brain. Symptoms There are two types of sex headaches: - A dull ache in the head and neck that intensifies as sexual excitement increases - A sudden, severe, throbbing headache that occurs just before or at the moment of orgasm In some people, both types of headaches are combined. Most sex headaches last at least several minutes. Others may linger for hours or even two to three days. Many people who have sex headaches will experience them in clusters over a few months, and then they may go for a year or more without having any sex headaches. Up to half of all people with sex headaches experience them over the course of about six months. Some people may only have one attack during their lives. When to see a doctor Sex headaches aren't usually a cause for concern. But consult your doctor right away if you experience a headache during sexual activity - especially if it begins abruptly or it's your first headache of this type. Causes Any type of sexual activity that leads to orgasm can trigger sex headaches. Abrupt-onset and slow-to-build sex headaches can be primary headache disorders not associated with any underlying condition. Sex headaches that come on suddenly are more likely to be associated with: - A widening or bubble in the wall of an artery inside your head (intracranial aneurysm) - An abnormal connection between arteries and veins in the brain (arteriovenous malformation) that bleeds into the spinal fluid-filled space in and around the brain - Bleeding into the wall of an artery leading to the brain (dissection) - Stroke - Coronary artery disease - Use of some medications, such as birth control pills - Inflammation from certain infections Sex headaches associated with loss of consciousness, vomiting, stiff neck, other neurological symptoms and severe pain lasting more than 24 hours are more likely to be due to an underlying cause. Risk factors Sex headaches can affect anyone. But risk factors for these headaches include: - Being male. Men are more prone to having sex headaches. - History of migraines. Being prone to migraines increases your risk of sex headaches. Diagnosis Brain imaging Your doctor will likely recommend brain imaging. - Magnetic resonance imaging (MRI). An MRI of the brain can help detect any underlying causes for your headache. During the MRI exam, a magnetic field and radio waves are used to create cross-sectional images of the structures within your brain. - Computerized tomography (CT). In some cases, especially if your headache occurred less than 48 to 72 hours beforehand, a CT scan of your brain may be done. CT uses an X-ray unit that rotates around your body and a computer to create cross-sectional images of your brain and head. - Magnetic resonance angiography (MRA) and computerized tomography (CT) angiography. These tests visualize the blood vessels leading to and inside your brain and neck. Angiograms Your doctor may also order a cerebral angiogram, a test that can show the neck and brain arteries. This procedure involves threading a thin, flexible tube through a blood vessel, usually starting in the groin, to an artery in your neck. Contrast material is injected into the tube to allow an X-ray machine to create an image of the arteries in your neck and brain. Spinal tap Sometimes a spinal tap (lumbar puncture) is needed as well - especially if the headache started abruptly and very recently and brain imaging is normal. With this procedure, the doctor removes a small amount of the fluid that surrounds your brain and spinal cord. The fluid sample can show if there's bleeding or infection. Treatment In some cases, your first sex headache may also be your only one. Some sex headaches improve rapidly, so the pain is gone before any pain reliever can work. Preventive medications If you have a history of sex headaches and there's no underlying cause, your doctor may recommend that you take preventive medications regularly. These may include: - Daily medications. Beta blockers, for example, propranolol (Inderal, Innopran XL) or metoprolol (Lopressor, Toprol-XL) - which are used to treat high blood pressure, coronary artery disease and migraines - may be taken daily to prevent sex headaches. They're recommended only if you have frequent or prolonged attacks. - Occasional medications. Indomethacin (Indocin, Tivorbex), an anti-inflammatory, or one of the triptans, a class of anti-migraine medications, can be taken an hour before sex to prevent headaches. 

Answer: Sex headaches are headaches caused by any type of sexual activity. They may be associated with the following: a widening or bubble in the wall of an artery inside your head (intracranial aneurysm); an abnormal connection between arteries and veins in the brain (arteriovenous malformation) that bleeds into the spinal fluid-filled space in and around the brain; bleeding into the wall of an artery leading to the brain (dissection); stroke; coronary artery disease; or use of some medications, such as birth control pills.