We all scream for ice cream, but sometimes snarfing down a cold treat in a hurry makes us scream — in agony.

We clutch our heads. We squeeze our eyes shut and wait for what seems like an eternity for that sudden burst of pain behind our eyes to subside. Then when all is well again, we take another bite.

In honor of National Ice Cream Month, we asked local doctors to break down the biological chain reaction behind an ice cream headache — or brain freeze, as some folks call it.

The trigger, of course, is the cold. Then things start to snowball.

“The thinking is when this super cold ice cream hits the roof of your mouth, your body’s initial reaction is that the blood vessels there constrict,” explained Dr. Jessica Heiring, an expert in headache and migraine management at the Minneapolis Clinic of Neurology.

It’s a shock to your system similar to putting your hand on a hot stove. Your body senses something has gone awry, but unlike with the stove, it can’t solve the problem simply by pulling away. So it rushes blood flow to the area to try to warm it up.

Meanwhile, the nerves that run alongside your blood vessels near the roof of your mouth sense the neighboring blood vessels shrinking and dilating. Then they, too, react.

“When the vessels shrink and dilate like that, the nerves next to it try to send signals up to your brain saying the vessels are really dilating — something’s happening inside our mouths,” Heiring said.

But the brain misinterprets the location of the pain. That’s because those nerve signals from your mouth reach a large nerve center in your brain, where more of the input received comes from nerves in the face. And for that split second, the brain thinks the cold temperature pain in your mouth is also in your face.

This produces a “referred pain,” explained Dr. Rohan Lall, a neurologist with Fairview Southdale in Edina. Seconds later, the brain sorts it all out and realizes the extreme cold and dilating blood vessels are actually inside your mouth.

“The blood gets there, the nerves stop firing, and everything returns to its normal, happy place,” Heiring said.

How bad and how long the hurt lasts varies from person to person. Some people experience blinding pain that stops them in their tracks for minutes on end.

But most people feel the burn for just a few seconds, Lall said.

There are also those rare, hardy souls who have never had an ice cream headache.

“Some may never feel that sensation in their life,” Lall said, “and for others, every time they have ice cream, they feel it.”

So what’s a Rocky Road-loving person to do? Some people swear by this trick: Place your tongue on the roof of your mouth when you start to get a brain freeze.

“Because your tongue has a lot of good flow, it can warm up the palate quicker,” Heiring said. “Also, drinking something warmer right away would help.”

That’s why people who drink coffee with their ice cream are less prone to brain freeze, she said.

Another approach is to go slow and eat a smaller amount at a time. A large mouthful of ice cream increases your chance that the cold stuff will hit your palate and shock your body.

And if you’re devouring a root bear float or a malt, use a spoon instead of a straw. That minimizes the chance of the cold liquid hitting the roof of your mouth, Heiring said.

“A quick temperature change — that’s the trigger for all of this,” she said.