On Thursday night, with four minutes left in the first game of this year's NBA finals, Miami Heat star LeBron James scored to pull his team within two. He immediately pulled up, then began hobbling over to his team's bench before teammates and trainers had to carry him the last few feet.

With LeBron out, the San Antonio Spurs outscored the Heat 16-3 and won the game easily.

people with high levels of sodium in their sweat are naturally prone to cramping

James' problem was a muscle cramp — a common, non-severe injury that struck at the worst possible moment. LeBron haters across the web seized it as an opportunity to question his toughness.

But here's the thing: muscle cramping is a legitimate, immobilizing problem that can befall even elite athletes. Dehydration and muscle fatigue are both involved, and heat can exacerbate the problem — making the fact that the AT&T Center's air conditioning went out during the game, driving court temperatures as high as 90°F, especially important.

Most importantly, some people with high levels of sodium in their sweat seem to be naturally prone to cramping. James may well fall in that category.

The only real ways to relieve muscle cramping are rest, stretching, and massage. So even though LeBron surely wanted to play through the injury, it physically just wasn't possible for him to make his legs work the way they would've needed to.

Dehydration and muscle fatigue cause cramping

You've probably experienced a muscle cramp before: a sudden, involuntary blast of pain as one of your muscles locks up for seemingly no reason. Exercise-associated muscle cramps, as scientists call them, are one particular type of cramp, the kind that befell LeBron last night.

Despite how common they are, scientists have debated the cause of these cramps for years. Part of the reason is that they're hard to study — you can't really put people in a lab and try to induce muscle cramps in them, because they happen so randomly.

both of the mechanisms can be driven by excessive heat

Over time, two hypotheses about the cause of cramps emerged. One held that repeated overuse of specific muscles leads to excessive activity in sensory receptors inside them, called muscle spindles. This activity then triggers a cascade of changes in the nervous system, ultimately disabling the mechanisms that are normally responsible for making sure muscles don't contract too much. The outcome is muscle cramping: an involuntary, excessive contraction of muscle.

The other hypothesized cause is a little more intuitive: dehydration, and the resulting depletion of electrolytes in your body. Over time, excessive sweating — and a failure to replace the electrolyte salts naturally present in your body — can cause sodium levels to dip dangerously. This upsets the balance of fluids in different compartments of your muscle cells, which makes your muscle fibers more likely to fire, ultimately causing your muscles to contract uncontrollably.

Ultimately, most scientists have come to the conclusion that both of these mechanisms sometimes cause cramping, sometimes in combination. And both of them, it turns out, can be driven by excessive heat.

Some people are naturally more prone to cramping, and heat makes it worse

It's impossible to say for sure what happened to LeBron last night, but it seems that both mechanisms probably played a role, helped along by the AT&T Center's faulty air conditioning. Sure, everyone had to deal with that heat, but James had played 33 of the 40 minutes of the game before initially cramping up, increasing both his sweat output and muscle fatigue.

Long-term muscle overuse can also contribute to cramping, and LeBron had also played in 92 of the previous 97 Heat games, averaging about 38 minutes on the floor per night, all while doing a huge amount of running for a man his size.

research among football and tennis players shows that people with more sodium in their sweat cramp more often

But there's also the unfortunate fact that some people — even elite athletes — are just more prone to cramping, because they have higher salt levels naturally present in their sweat. Research among football and tennis players has shown that people with more sodium in their sweat cramp much more often.

Despite a world-class NBA training staff, LeBron has battled muscle cramping in a number of high-profile games throughout his career — including Game 4 of the 2012 Finals — so he's probably part of this group.

"Drank a lot at halftime, even, changed my uniform, just tried to get the sweat up off of you," James told reporters after the game. "Our training staff tried to do the best they could by giving us ice bags and cold towels on timeouts, keep us dry." For a salty sweater in a 90°F arena with broken air conditioning, though, this apparently wasn't enough.

The only real treatment is rest

Sports scientists have looked for a medication that could cure muscle cramps for years, and found nothing. It's widely agreed that, apart from trying to get rehydrated as quickly as possible, the only effective treatments to get your muscles working again are resting, stretching, and getting massaged.

lebron physically wasn't capable of staying in the game

LeBron physically wasn't capable of staying in the game. Right after scoring his last basket, his entire left leg cramped up, rendering him so immobile that he couldn't even walk down the court.

Toughness might let players play through pain. But it doesn't let anyone deal with muscle contractions so extreme that they don't let you bend your knee.

"The best option for me was to not move," James told reporters. "I tried and any little step or nudge, it would get worse. I would lock up worse and my muscles spasmed ten out of ten. Best thing for me to do was just not to move and, you know, it was frustrating."