With soda sales sliding in grocery and convenience stores and other retail outlets, the new equipment offers the companies a means of introducing consumers to their products — carbonated or not — in a playful way. "These machines are all about engaging with consumers and allowing them to drive the relationship," said Mauro Porcini, PepsiCo's chief design officer.
Determined not to let Pepsi steal Coke's thunder, Jennifer Mann, general manager of Freestyle, went on a road trip this week to show customers new, smaller models that address one of the chief complaints about Coke's machine, the floor space it occupies.
Read MorePepsi ripped for having 'culture of sycophants'
"These are not just pieces of equipment," Ms. Mann said. "They represent a chance for us to help our customers engage with their consumers in a new way that is driving sales and traffic."
Coke dominates the fountain business, deploying its equipment and syrups in what analysts estimate to be roughly 70 percent of the restaurants, movie theaters, dining halls and other spots where soda is served on tap.
Coke, after all, started as a fountain business, whereas Pepsi began selling cola in bottles, avoiding a fight with its rival at the drugstore lunch counter. The most recent innovations in fountain technology occurred about three decades ago, when bulky metal machines with six, eight or more valves started moving out from behind the counter and inviting customers to fill their own cups.
In an effort to recapture some of the magic of a drugstore soda fountain, Coca-Cola began working in 2004 to reinvent the fountain machine, a device both beverage companies had long left in the hands of third-party equipment manufacturers.
Read MoreCoke, Pepsi dropping 'BVO' from all drinks
Six years later, Freestyle made its debut. It was a sleek, red retro machine with an embedded touch screen and had been designed by the same Italian company that gave Ferraris their contours. Freestyle offered customers the chance to experiment with 100 different Coca-Cola products to concoct drinks that came out of a single dispenser in pulsating bands of color.
Suddenly, the fountain business was sexy.
Coke has used feedback from Freestyle to offer tailor-made beverages, like Thor Thunder Fusion, a limited-edition drink concocted to coincide with the opening of the movie "Thor: The Dark World" last fall and available only at four AMC theaters in the Atlanta area.
There are now 20,000 Freestyle machines scattered around the country in restaurant chains like Firehouse Subs, Moe's Southwest Grill and Burger King. McDonald's — an account so important to Coke that it is the sole responsibility of a single executive — has begun testing the equipment in some locations.
McDonald's is one big reason for Coke's dominance of the fountain business. The close relationship between Coke and McDonald's goes back 60 years and exemplifies the uphill battle Pepsi faces.
Read MoreCoca-Cola raises stake in Keurig Green Mountain
Some analysts, however, have been lukewarm about Freestyle. "It has helped Coke's customers from a volume standpoint but not necessarily from a revenue and profit standpoint," said John Faucher, an analyst who follows the beverage industry for JPMorgan Chase. "These machines are going to have to drive new traffic if they are really going to take off."
Coke has added a map with the location of Freestyle machines to its Freestyle app, and its new machines address concerns about space.
They do not, however, address another issue food service companies have with Freestyle. The machine relies on cartridges loaded with flavorings to deliver drinks, while the traditional system uses hoses connected to five-gallon plastic-bag-lined boxes of syrup.
Although the 23-ounce cartridges require far less storage space, they are more expensive than the traditional bag-in-box system.
Read MoreThere seems to be a Dr Pepper craze, says Cramer
PepsiCo's Spire comes in three sizes and uses bag-in-box.
Marcus Theatres, a chain of 55 movie houses in the Midwest, has been testing a midsize Spire machine at its Majestic Cinema in Brookfield, Wis. "We're pretty conservative in our use of technology because the interface with the consumer can sometimes be negative," said Rolando Rodriguez, chief executive of Marcus Theatres. "But we're seeing that Spire is actually something consumers are seeking out — and the benefit of that is higher soda and snack sales for us."
He said young and old alike are fascinated with the machine and like the wide variety of drink choices it offers them.
Spire's smaller size was a factor in winning Buffalo Wild Wings from Coke earlier this year, and in many locations where the equipment has been tested, the restaurant chain has two or more machines, which helps reduce lines that can develop when only a single machine is available.
Read MoreBuffett's abstention prompts Coke to rethink plan
The biggest Spire can make more than 1,000 drink combinations. PepsiCo hopes to use its ample touch screen to offer consumers a chance to enter contests and to show them videos of the celebrities who promote PepsiCo's products.
John Sicher, editor and publisher of Beverage Digest, said the machines were one of the biggest developments for the companies and their customers in years because of their potential to introduce consumers to new drinks and to market directly to them.
"These are potentially of very real value to restaurants because of the vast range of choices they can offer consumers, making them a sort of beverage destination," he said. "And that, in turn, may help the beverage companies."