All headaches cannot be stopped by an over the counter medication. There are many reasons for headaches and many different treatments but the best treatment is learning what kind of headache you have and what triggered it.
Below you will find different kinds of headache, what causes them, and possible ways to find relief.

Image via Wikipedia
Migraines
Are you overweight? Obesity causes inflammation of the blood vessels that can cause migraine pain. People who are overweight also produce more hormones which produces a greater risk for migraines.
Skipping a meal, losing sleep, drinking alcohol, eating aged cheese,stress, and not getting enough exercise can trigger a migraine.
For Relief
Moderate migraines can be treated with over the counter anti inflammatory drugs such as Ibuprofen and Naproxen. If you have more than 4 a month or a severe migraine that can't be controlled with an over the counter medication, make an appointment with a headache specialist.
Keep a journal of your headaches to find out what seems to cause them. Let your doctor know how often they occur, how long they last, what medication you have taken, what you had eaten and anything else that could have triggered the migraine.
The prescription medications your doctor might prescribe are:
Beta blockers, Calcium channel blockers, or tricyclic antidepressants, Botox may be helpful by blocking the nerve impulses for pain.

Image via Wikipedia
A Caffeine Withdrawal Headache
If you normally drink two or three cups of coffee and skip the coffee one morning, the nagging pain you get is your brain begging for caffeine. Caffeine is a stimulate and your brain gets used to it over time. Remember caffeine is in tea, soda, and energy drinks.
For Relief:
BC powder or Goody will usually give relief.
To avoid this type of headache, cut back on caffeine gradually. Eventually limit yourself to 100 mg a day. That's a cup of coffee or a soda.

Image via Wikipedia
A Tension Headache
Stress is a common cause but anything that forces the neck and shoulders out of alignment such as bending over the computer, cradling the telephone on the shoulders, wearing super tight bra straps, carrying a heavy hand bag, can cause a tension headache.
For Relief:
Aspirin or Ibuprofen works but don't use more than once or twice a week. Over the counter medication can lead to another headache. Regular exercise such as stretching and yoga is a good preventive.
If you have as many as 10 headaches a month, worry a lot and have trouble sleeping, have your doctor to screen you for depression. Anti depressants can treat both pain and depression.
Menstrual Headache
The drop of estrogen just before your period can set off a menstrual migraine. It can begin anywhere from 2 days before to three days afterwards. It's usually intense pain on one side of the head, nausea, and sometimes auras.
For Relief:
Two or three days before your period take an over the counter pain reliever such as aspirin, or ibuprofen even if you don't have a headache. Take it three times a day. If you take birth control pills consider skipping the placebo week. keeping hormone level during the month may keep the headaches away.
If this still doesn't help ask your doctor about a triptan drug. It shrinks the swollen blood vessels in the head back to normal and blocks nerve impulses.

Image by brittanyculver via Flickr
A Rebound Headache
Constantly taking an over the counter medication for more than two or three times a week can wreck havoc on your body. It can end up making the pain worse and more frequent. It causes the nerves at the base of your brain that block pain to forget their job.
For Relief:
Wean yourself off the usual medication by taking another kind of pain killer. Ask your doctor about taking an acetaminophen. If a prescription drug is causing your rebound headache ask your doctor to lower the dosage or change the medication.
A Sinus Headache
These headaches are accompanied by a thick nasal discharge,sore throat, cough, and fever. Causing pressure around your forehead, cheeks, and eyes. Often worse when lying down or bending over.
For Relief:
You will need an antibiotic to clear up the infection. A decongestant with an over the counter pain reliever should help ease the pain until you get the antibiotic. In the meantime give yourself a facial steam. Heat a pan of water and hold your face near the steam with a towel over your head. Also flush your nose with a mixture of warm water and 1/4 tsp. of salt. If your head is clear your headache could be an allergy headache. If so antihistamines can help.