Updated

What do a cup of coffee, a bowl of beans, and a couple of ibuprofen have in common? Surprising answer: They all reduce pain. "Popping a pill may be easier, but it does nothing to cure the underlying cause of your pain like eating the right foods can do," says Beth Reardon director of integrative nutrition at Duke Integrative Medicine. And the number of foods proven to offer relief is growing. Here are six common aches and pains and the foods that help fight them.

Achy joints

Food Rx: Cherries, turmeric
Here's sweet news: Preliminary research suggests that eating about 20 tart cherries may be as effective as taking ibuprofen for reducing pain. In a more recent study, eating about 45 cherries a day reduced C-reactive protein, a major marker of inflammation associated with arthritis, by 25 percent. Likewise, the spice turmeric contains curcumin, a compound that in one study eased pain as well as ibuprofen did in people with knee osteoarthritis.

Sore Muscles

Food Rx: Ginger
Walking like a cowboy after that set of squats? Sip ginger tea. In a recent study, people who lifted weights experienced 25 percent less post-workout pain 24 hours after consuming ginger (about half a teaspoon a day for 11 days) than those taking a placebo. Researchers credit gingerols, antioxidants that have anti-inflammatory, pain-relieving properties. (More great ginger news, here.)

Heartburn

Food Rx: Beans
While fiber giveth (gas), it also taketh away (acid reflux). A study in the journal Gut found that people who regularly ate high-fiber foods like beans were 20 percent less likely to report GERD (gastroesophageal reflux disease) symptoms, probably because fiber moves food out of the stomach faster and prevents reflux. (See how else you can sneak in more fiber.)

Digestive Pain

Food Rx: Peppermint, coconut
The menthol in fresh peppermint and peppermint tea acts as a carminative (a compound that relieves gas and bloating) and a muscle relaxer, which can help relieve the cramping and spasms associated with occasional intestinal distress and full-blown IBS. For diarrhea, Reardon suggests eating 1 to 3 teaspoons of shredded unsweetened coconut, which has anti-inflammatory and antimicrobial properties.

PMS Cramps

Food Rx: Nuts
Your body may be telling you that you need brownies, but opt for trail mix when that PMS funk hits. A study in the American Journal of Clinical Nutrition found that women with the highest intakes of riboflavin from foods such as almonds were more than a third less likely to develop PMS, including cramps and brain fog, than those who had the lowest intakes. Foods high in vitamin B6, such as pistachios, can also help reduce irritability, cramps, and fluid retention associated with PMS, says Reardon. (In fact, you can forget cramps all together when you follow these tips to prevent period cramps.)

Food Rx: Coffee, pumpkin seeds
Your pounding head is often a result of dilated, or enlarged, blood vessels in your brain. Caffeinated drinks such as coffee can help constrict blood vessels and ease the pain; they also make painkillers work better so you can reduce your dose. But if you have the mother of all headaches—a migraine—you may be deficient in magnesium and could benefit from foods rich in this nutrient, such as pumpkin seeds, says Reardon. Magnesium helps calm the overexcited nerves and tense muscles that contribute to migraine pain. (It's also one of our 25 Best Foods For Your Heart.)