When experiencing gallstones, consuming fatty foods can cause pain and diarrhea. (For Corewell Health Beat)

They can be as small as a grain of sand, or as large as a golf ball.

And they can cause a great deal of pain.

Gallstones affect millions of people of all ages every year.

Certain factors can increase your risk. If you’re a woman—and if you’ve had children—or if you’re over the age 40, the risk of developing gallstones is higher.

Other contributing factors include excess weight, having diabetes or having a family history of gallstones.

Gallstones can lead to a gallbladder attack, which can start with waves of cramping below the right side of the rib cage before gradually radiating into the back, progressing to severe pain, nausea, diarrhea or vomiting.

And because the typical American diet is high in fats—often higher in animal fats than plant-based fats—gallbladder issues have become quite common.

“We are not sure what exactly causes the gallbladder to go bad, but we know that stones result from cholesterol in bile,” Jeffrey Gawel, MD, general surgeon at Corewell Health, said. “Reducing your cholesterol can be a good preventive measure, as well as losing weight in general.”

Gallstones typically affect people ages 20 to 74 , but they can also develop in patients in their mid-teens and those in their 80s or 90s.

For younger people, obesity can be a contributing factor. For older people, it may simply result from an aging gallbladder.

What are gallstones?

The gallbladder stores bile that’s produced by the liver. That bile is primarily a mixture of cholesterol, bilirubin and bile salts.

After you eat, the gallbladder releases bile through small ducts into your digestive system, to help digest fats. Some of those substances, however, can harden into gallstones, which can become stuck in the digestive ducts and block the flow of bile.

That can cause the gallbladder to spasm, which creates gallbladder attacks.

“There’s a myth that a gallbladder attack can happen after eating a large meal,” Dr. Gawel said. “That’s not entirely true. It’s not the size of the meal but the quantity of fats in the meal that stimulates the gallbladder—and that can bring on an attack, usually about a half hour after the meal.”

A gallbladder attack can last anywhere from 30 minutes to four hours.

A doctor can diagnose gallstones in a variety of ways, including through use of ultrasound, a small-caliber scope called a SpyGlass, and a combination of X-rays and endoscopy.

Once diagnosed, gallstones must be treated. Untreated, they can lead to infection or inflammation, called cholecystitis, which can cause fever and pain.

And gallstones are not like kidney stones, which can pass through the body without medical intervention.

“If you have symptoms related to (gallstones), you will need to have surgery to remove your gallbladder,” Dr. Gawel said. “It’s the second-most common surgery I perform.”

The right treatment

The procedure to remove the gallbladder and any gallstones is called a cholecystectomy.

It takes less than an hour. For recovery, you’ll need about three to seven days before resuming regular activities.

Because the gallbladder is not an essential organ, you can live a normal life without it.

After a surgeon removes the gallbladder, the bile will flow out of the ducts and directly into the digestive system, rather than being stored in the gallbladder.

In the past, gallbladder removal had required major surgery. Today, it’s almost always performed via a minimally invasive laparoscopic outpatient procedure.

Before surgery and after, Dr. Gawel recommends patients avoid foods that are high in fat. That includes fast foods.

“One out of 20 people may notice an intolerance for fatty foods even after the surgery,” Dr. Gawel said. “They may experience diarrhea after a fatty meal. We recommend avoiding fatty foods immediately after surgery and then reintroducing fats into your diet gradually.”

Dr. Gawel also recommends avoiding untested quick fixes you might find on the internet.

“Don’t attempt what you may see online, called flushes,” he warned. “That’s ingesting straight oil after going for days without any fat in your diet in an attempt to ‘flush’ the stones out of your gallbladder. This can actually cause a gallbladder attack requiring emergency surgery.”

If you experience discomfort in your upper abdomen when eating fatty or greasy foods, schedule an appointment with your primary care doctor.