Cola wars spread to Twitter and LeBron James' legs

It just wasn't in him.

That's what Gatorade was tweeting about Miami Heat star LeBron James on Thursday when fans took to Twitter, mistakenly taunting the sports drink after James' early exit from Game 1 of the NBA finals.

LeBron James, No. 6 of the Miami Heat, sits on the bench after leaving the game in the fourth quarter with cramps against the San Antonio Spurs during Game 1 of the 2014 NBA Finals at the AT&T Center on June 5, 2014 in San Antonio.
Getty Images

"Hey @Gatorade," one Twitter user wrote, "Where's all your sports science magic for preventing cramps in your no. 1 client @KingJames?"

James did in fact suffer from cramps in his legs, but it turns out he's actually sponsored by Coca-Cola's Powerade, not PepsiCo's Gatorade. And Gatorade made sure to distance itself in its sly response to the fan's misdirected dig.

"The person cramping wasn't our client," tweeted Gatorade. "Our athletes can take the heat."

It's just the latest high-profile skirmish in a beverage battle that has raged for years between Coca-Cola and PepsiCo.

Read MoreCrowning the most 'social' sports teams in the US

"Gatorade is the undisputed leader in sports drinks," said Adam Fleck, an equity analyst at Morningstar. "But Powerade has been clawing away some market share in recent years."

According to data from Beverage Digest, Pepsi moved 630 million cases of Gatorade in North America for 2013, down from its 2007 volume of 670 million cases, while Coke sold 225 million cases of Powerade, up from 190 million in 2007.

Ballmer to buy NBA's Clippers for $2B
Ballmer to buy NBA's Clippers for $2B

That's exactly the trend that Coca-Cola hopes to continue by bringing star athletes like LeBron James under the Powerade banner. It's a tall task though, says Patrick Rishe, a sports economics professor at Webster University.

"At the end of the day, Michael Jordan solidified Gatorade's prominence in that industry," said Rishe, citing the NBA great's decadeslong relationship with Pepsi's sports drink. "It's going to be difficult for other companies to catch Gatorade."

Alicia Jessop, a sports law professor at the University of Miami, agreed.

"What yesterday showed me is just how strong a hold Gatorade continues to have over the sports beverage marketplace," she said. "Even though LeBron James has been a Coca-Cola athlete, and particularly a Powerade athlete, since joining the NBA, people associated him with Gatorade."

Read MoreMoney Pony: 'Chrome' could break betting records

It's an easy mistake for fans to make, says David Carter a professor of sports business at the University of Southern California. Gatorade has been the NBA's official sports drink sponsor since 1984, and is able to place its logos in prominent places at NBA games, including on teams' courtside drink coolers.

"He may be aligned with one firm, but on one of the largest stages, it would be easy to believe that LeBron is with Gatorade," said Carter. "Just the visuals would make it look that way unless you were a loyal consumer of Powerade or a loyal fan of LeBron James."

The University of Miami's Jessop says Coca-Cola needs to do more to link Powerade to the athletes it sponsors.

"If you watched the game last night, there was a Sprite commercial that Coca-Cola ran with LeBron," said Jessop. "Why aren't they activating more with Powerade during the sporting event?"

Powerade sticks by LeBron

On the other hand, says Jessop, Gatorade's handling of the confused Twitter trolls was spot-on.

"That is something that should be in a public relations handbook, the way that Gatorade handled this situation," she said. "They handled it in a way that was true to their brand, in a way that wasn't too serious."

Webster University's Rishe isn't as enthusiastic about Gatorade's response.

"I thought it was kind of petty," said Rishe. "The implication is that if he wasn't drinking Powerade he wouldn't be having these issues, and I think that would be really difficult to substantiate."

Powerade, for its part, is standing by James.

"Powerade has been alongside King James through multiple MVPs, titles, gold medals, and countless 'did you see that??' moments," the company said in a written statement. "We're riding with him during his quest for more hardware and look forward to watching him power through like he's done so many times before."

—By CNBC's Adam Molon.