When stomach upset hits, if you’re like most people you blame that awful cramping, diarrhea, nausea and other gastrointestinal (GI) distress on something you ate. It’s true that one in six US adults do experience a bout of food poisoning every year (see below). But there are other culprits that are less recognized… 

Medications. Certain prescription and over-the-counter medications can cause GI distress…

Nonsteroidal anti-inflammatory drugs (NSAIDs). Ibuprofen (Advil, Motrin), naproxen (Aleve) and other NSAIDs are known to cause dyspepsia. Dyspepsia, better known as indigestion, is marked by pain and burning in the upper abdomen, below the breastbone, and queasiness without vomiting. Dyspepsia can also occur with other drugs such as some antibiotics (see below).

In one Canadian study, up to 30% of patients with dyspepsia were found to be taking an NSAID. What helps: Try lowering your NSAID dose, but realize that some people cannot tolerate even a low dose. If this approach doesn’t help, try switching to acetaminophen (Tylenol), which may be equally effective in treating pain but without stomach discomfort. Note: Long-term use of an NSAID or acetaminophen can have side effects. Both types of pain relievers are for occasional use only.

Proton pump inhibitors (PPIs). These stomach acid medications have been linked to higher rates of diarrhea caused by the dangerous Clostridium difficile bacterium. Chronic PPI use (generally, more than six months) reduces the diversity of bacteria in your GI tract, possibly allowing unhealthy bugs to thrive.

Commonly used PPIs include esomeprazole (Nexium), lansoprazole (Prevacid) and omeprazole (Prilosec). If you experience persistent, watery diarrhea, stomach pain and fever, and are taking a PPI, talk to your doctor. He/she may test you for Clostridium difficile–associated diarrhea, which can be treated with antibiotics. If PPI use causes GI distress, ask your doctor about taking ranitidine (Zantac) on an as-needed basis—it’s less likely to cause stomach problems than PPIs.

Antibiotics. Azithromycin (Zithromax, Zithromax Z-Pak) and erythromycin (Eryc, Ery-Tab) are among the antibiotics most likely to cause diarrhea by speeding up food’s transit time through the intestine. Typically, you just have to ride it out, being sure to stay hydrated. Helpful: Water with a splash of orange juice and a pinch of salt is an effective, inexpensive substitute for store-bought, electrolyte-infused water. Also: Ask your doctor whether your antibiotic can be taken with food—such as crackers—to help prevent GI symptoms. Some data suggest that taking probiotics may help counteract the GI effects of antibiotics. Get them via fermented foods such as kefir, sauerkraut, yogurt, kimchi and miso soup. Never stop an antibiotic without first consulting your doctor.

Selective serotonin reuptake inhibitors (SSRIs). This class of antidepressants, including fluoxetine (Prozac), sertraline (Zoloft) and paroxetine (Paxil), can cause nausea and diarrhea in some patients. This usually subsides in a few weeks.

FODMAPs, or fermentable oligosaccharides disaccharides monosaccharides and polyols. These are difficult-to-digest sugars such as lactose, found in dairy products…fructose, in fruit…fructan, in wheat and good-for-you veggies including asparagus, onions, garlic and artichokes…and galactans, in complex carbohydrates such as beans, including kidney beans, chickpeas and soybean products.

For unknown reasons, in some people, the carbohydrates in high-FODMAP foods don’t get digested in the small intestine. The undigested carbohydrates advance to the large intestine, where bacteria feast on them, causing cramping and gas, and draw excess water into the colon, triggering diarrhea. If your GI discomfort flares up when eating one of the foods above, see a gastroenterologist to find out if FODMAPs are to blame. Helpful: The American Gastroenterological Association offers a downloadable guide for following a low-FODMAP diet.

Stomach flu. At least 20 million Americans are hit with acute gastroenteritis (commonly known as “stomach flu”) every year. It’s usually caused by the norovirus, which spreads rampantly through crowded areas such as hospitals, airplanes, cruise ships and nursing homes. The virus makes its way from an infected person’s feces or vomit into your mouth, usually when you touch a contaminated surface (a toilet handle or an ATM machine, for example) or eat food prepared by a person who is infected.

Symptoms such as diarrhea, vomiting, stomach pain, fever, headache and body aches usually begin within 12 to 48 hours of exposure, and most individuals recover in one to three days. There is no effective treatment. Protect yourself with thorough handwashing using soap and water. An alcohol-based hand sanitizer should not be used as a substitute for soap and water. Good handwashing is essential to avoid transmission. If you become sick, avoid preparing food for others.

Note: Stomach flu is not the same as the flu, which is a respiratory illness caused by the influenza virus. For this reason, getting a flu shot won’t protect you from stomach flu. Also, stomach flu is easily confused with food poisoning, which causes similar symptoms. For more on food poisoning, see below.

Too much fiber. Following a high-fiber diet is a healthy move. But consuming too much fiber too quickly can cause cramping, bloating and gas. Better: Gradually increase your consumption of produce (such as broccoli, carrots, avocado, apples, pears and figs) and beans by one to two servings a day—or a fiber supplement by one tablespoon a day. As long as you experience no adverse GI symptoms, continue increasing your intake slowly for a total of 30 g of fiber per day for men…and 21 g for women. If you are taking a laxative for constipation, synthetic fibers such as methylcellulose (Citrucel) may be less gas-forming than natural fibers such as psyllium (Metamucil).

Stress. If you’ve ever been stuck on the toilet due to nerves, you know that the brain and belly are linked. Numerous studies have suggested that some GI problems may have a neurological component.

Why: More than 100 million neurons (cells that carry messages from the brain to other parts of the body) line the human GI tract—creating “the second brain.” Not only can stress lead to upset stomach, new research suggests that the effect may also work in reverse, possibly explaining why many people with irritable bowel syndrome and other GI disorders develop depression and/or anxiety. Cognitive behavioral therapy or hypnotherapy tailored for GI issues may help. Ask your doctor for a referral.

What If It Is Food Poisoning?

Food poisoning is no fun! If you consume food that has been contaminated with bacteria, such as E. coli or Staphylococcus aureus, the telltale symptoms, including abdominal cramps, diarrhea and vomiting, often come on suddenly and typically last for 72 hours or so.

Due to the “transit time” it takes food to make its way through your body’s digestive system, it’s likely that something you ate a few hours before symptoms began—or even a few days earlier—is to blame.

Foods that most often cause food poisoning: Undercooked meat or poultry, ground meat, unpasteurized dairy, improperly washed fresh produce and food contaminated by a sick food handler. Note: Many fast-food chains source their meat and eggs from multiple farms, increasing your risk for exposure to bacteria.

If you get food poisoning, be sure to stay hydrated (drink enough fluids so that your urine is light colored). Dizziness when standing can be caused by dehydration. Uncontrolled vomiting requires prompt medical attention. Important: If you experience vomiting and diarrhea for more than 72 hours—or bloody diarrhea at any time—call your doctor. You may have a particularly virulent strain of E. coli that can cause kidney failure and may require IV fluids and perhaps even short-term dialysis.