When she woke up one morning last year, Nicole Martin of Teaneck, New Jersey, suddenly felt a rumbling in her side, like an avalanche. “Then the pain moved in like — boom — excruciating pain,” recalls the 42-year-old mother of two. “I couldn’t move. I couldn’t talk. It was like someone was stabbing me in the lower back repeatedly. I thought ‘I’m dying, I’m dying, I’m dying.’”

A friend drove Martin to the hospital. On the way she screamed, cried, squirmed and vomited. Once there, a CT scan revealed three kidney stones. Within 24 hours, she passed one of the stones through her urine. “It hurt more than having a baby,” Martin says.

An avalanche of kidney stones

Every year, more than half a million people head to the ER because of kidney stones — small, hard, jagged masses of salt and mineral deposits that form inside kidneys.

“They’re like tiny rocks. When they obstruct the ureter, or urinary tract, they cause quite a bit of pain and pressure,” says Thomas Chi, MD, an assistant professor of medicine in the University of California, San Francisco’s department of urology. More than half of people who get a kidney stone will have another within five years. Martin passed a second stone after six months and the final one a year later.

According to the National Kidney Foundation (NKF), the lifetime risk of developing kidney stones is approximately 19 percent for men and 9 percent for women. Going forward, the NKF expects those percentages to rise.

“We’re seeing increasing rates of diabetes, obesity and vascular disease, all of which research shows increase the risk of kidney stones,” Chi explains.

Other well-known risk factors for kidney stones include eating a high-sodium diet, a diet rich in animal products, dehydration and, besides diabetes, health problems such as high blood pressure, gout and chronic urinary tract infections.

Related: 5 Health Conditions that Can Get Worse in the Summer

Could you be kidney-stone prone?

Even though “most people have crystals in their urine, only ten to twelve percent develop kidney stones,” Chi says. “It has to do with genetics and other factors we don’t yet completely understand.” 

Here are five surprising ones and how to deal with them.

You live near a highway. Heavy metals, especially zinc, can hike the risk of developing stones, according to research Chi published in May in the journal PLOS ONE.

“The presence of zinc in kidney stones — both human and in the fruit fly model we developed — made us scratch our heads,” he says. “It seems to be the core of kidney stone formation.” Chi believes dust from tires may be a source of zinc in kidney stones. If you live near highway, it’s not a good idea to cut back on zinc in your diet because the body needs it for several key functions. Instead, consider installing an air filtration system in your home to clear the air of zinc (and other toxins).

You sweat a lot. Warm weather seems to be linked to greater incidence of kidney stones, according to a 2014 study published in the journal Environmental Health Perspectives. The research team, from the Children’s Hospital of Philadelphia’s Kidney Stone Center, looked at the medical records of 60,000 patients in several U.S. cities in relation to weather data. They found that after a rise in mean daily temperatures (50 degrees F and up), there would be an influx of kidney stone patients within the next three to 20 days.

The scientists believe that when people get hot and sweaty, they’re more likely to become dehydrated. This increases the concentration of calcium and other minerals in urine that promote the development of kidney stones. When the mercury rises, or if you go to a sauna, steam room or hot tub or take hot yoga, drink extra fluids to stay well hydrated.

Related: 6 Heart Attack Symptoms Women Ignore

You’ve got a soda habit. Being dehydrated may increase the risk of kidney stones. But when you reach for fluids, know that some beverages help‚ while others hurt. In a 2013 study that followed more than 194,000 people for eight years, a team led by Harvard Medical School found that drinking sugary sodas and fruit punches increased the risk of stone formation. The risk was 23 percent higher for people who drank the most sugar-sweetened soda and 33 percent higher for those who drank other sugar-sweetened, non-cola drinks. Artificially sweetened beverages caused a small bump as well.

Unfortunately, naturally sweetened drinks are no better. Earlier research has implicated apple juice and grapefruit juice. The good news is that drinking coffee (decaf or caffeinated), tea, beer, wine and unsweetened lemonade actually lower kidney stone risk.

Related: Lemon Water: The (Somewhat) Bitter Truth

You don’t get enough calcium. It may seem counterintuitive that not getting enough calcium raises the risk of kidney stones. After all, this mineral is a main component of stones.

In fact, eating calcium-rich foods can help prevent kidney stones, according to Mathew D. Sorensen, MD, assistant professor of urology at the University of Washington School of Medicine in Seattle. That’s because many healthy foods we eat contain a substance called oxalate that can contribute to kidney stones if it winds up in urine. But if there’s calcium in your stomach, oxalate will bind to it and be digested along with the rest of your meal. Sorensen recommends getting calcium from dietary sources, including yogurt, kale, bok choy and calcium-fortified foods. Skip supplements, which actually can increase kidney-stone risk.

You’re a couch potato. Spending too much time on your duff puts you at greater risk of stone formation. “When you aren’t moving, your metabolism slows,” explains Chi, “which can change the way your body processes metals, oxalates and other minerals that can get into the kidney and form stones.”

Luckily a little activity goes a long way to keep kidney stones away. In a 2013 study, researchers from the University of Washington School of Medicine found that even light exercise each week — jogging for an hour, walking for three hours or gardening for four hours — can lower risk of kidney stones by up to 31 percent. Lifting weights may be especially helpful, Sorensen adds, because it boosts uptake of calcium by bones, leaving less to be excreted into urine.

Ultimately, if you want to prevent kidney stones, Chi offers this prescription: Drink more, but stick to unsweetened beverages, eat less salt, swap out some animal protein for fruits and vegetables and get a little exercise every day.