Author and migraine sufferer Joan Didion once wrote, “That no one dies of migraine seems, to someone deep into an attack, an ambiguous blessing.”

At that time, migraines weren’t something that could be prevented. Today, that’s a possibility for some people who have severe migraines, frequent migraines (more than three or four times a month), or migraines that don’t respond well to treatment, according to the Harvard Medical School’s HEALTHbeat.

The cornerstone of migraine prevention is managing triggers like stress or certain foods or strong perfumes. Alternative and complementary therapies (like acupuncture) help some migraine sufferers keep headaches at bay.

In some cases, taking medication even when you aren’t having a migraine attack can help. This usually involves taking the medication every day, with the goal of gradually tapering the dose, and, ideally, eventually discontinuing it altogether. Here are some of the medications commonly used to prevent migraine. Because they have different effects, and potential side effects, it’s important to work with your doctor to find the one that’s right for you.

Beta blockers

Commonly prescribed for high blood pressure, abnormal heart rhythms, and heart-related chest pain, beta blockers may prevent migraines by not allowing blood vessels to expand too much (and put pressure on nerves). There are many beta blockers available, and it may take a while to find the one that works best for you.

Tricyclic antidepressants

These medications are sometimes used to help manage pain, including headache. Amitriptyline (Elavil, Endep) is the best studied for pain relief and the most often prescribed for migraine prevention: it’s about 60% effective in thwarting such headaches.

Calcium-channel blockers

Calcium-channel blockers are also used primarily for heart-related conditions, but help some people prevent migraine.

Anti-seizure medications

Topiramate (Topamax) and divalproex (Depakote) are anti-seizure drugs that are also specifically approved for migraine prevention. Gabapentin (Neurontin) is another that, while not specifically approved to prevent migraines, does work well for some people.

Other drugs

Although low-dose aspirin is far less effective than the standard migraine headache preventive medications, it may improve migraine control when used in combination with another preventive medication. It is important to check with your doctor before starting to take aspirin daily.

For more information on preventing, diagnosing and treating migraine and other types of headache, buy Headaches: Relieving and Preventing Migraine and Other Headaches by Harvard Medical School.