Read enough headlines and you'll think that Coca-Cola (NYSE:KO) won't survive, let alone thrive, in a world that has become increasingly hostile toward its key product. PepsiCo (NASDAQ:PEP), too, is under pressure to relinquish its beverage unit and focus on its thriving snacks business.

As usual, the market has focused on the latest data point at the expense of seeing the bigger picture. Carbonated soft drink volume has been declining for years, but both stocks have kept pace with the broader market. It was not until an especially slow year in 2013 that the market decided that the soft drink business was doomed. However, last year's stumble will only reinvigorate the soft drink giants and return their focus to long-term prosperity.

Complacency kills even great businesses
At Coca-Cola's 2013 annual meeting, the company's biggest cheerleader, Warren Buffett, warned its employees and shareholders about the devastating consequences of complacency:

The biggest thing that kills [great businesses] is complacency. You want a restlessness, a feeling that you know that somebody's always after you but you're going to stay ahead of them. You always want to be on the move. When you've got a great business like Coca-Cola...the danger [is] that you rest on your laurels.

Buffett says that not even great businesses can afford to be complacent. The market, it seems, is judging Coca-Cola and PepsiCo to be just that: complacent.

This is not a completely unfair assessment, either. Coca-Cola has traditionally relied on just a few brands to drive a majority of its revenue. Coke and Diet Coke alone account for more than a quarter of all U.S. carbonated soft drink sales. In 2012, the company passed on an opportunity to buy energy drink giant Monster Beverage in what would have been a roughly $15 billion acquisition. For 128 years, Coca-Cola's addictive sugar-and-caffeine-infused beverages have carried the company through good times and bad -- so management may be wondering why the company needs to change now.

The same can be said for PepsiCo, for which CEO Indra Nooyi vigorously defended the status quo on the company's quarterly conference call with analysts and shareholders. Instead of laying out a radical transformation plan, Nooyi declared that the company would ride out the storm by emphasizing synergies between the snack and beverage businesses. The market did not take the news well; the stock is down about 2% since the conference call.

Coca-Cola and PepsiCo can still thrive in a changing world
Despite the setback of continued declines in U.S. soft drink sales, Coca-Cola and PepsiCo are positioned to dominate the non-alcoholic beverage market for another century. Both companies sport global distribution networks and enormous marketing budgets. Even large brands like Monster and Red Bull would become instantly more valuable under the wings of Coca-Cola or PepsiCo by way of economies of scale in distribution and marketing.

However, both companies must adapt to changing consumer desires. PepsiCo jumped in front of the health trend by investing in its Good-For-You and Better-For-You beverage categories. However, the company has paid the price for neglecting its soft drink business. With the inclusion of energy drink sales, PepsiCo's share of the carbonated soft drink market declined three percentage points to 28.1% from 2007 to 2012. Over the same period, Coca-Cola's share fell just eight basis points, or 0.08 percentage points, to 42%.

While PepsiCo overplayed the health trend by essentially ditching its U.S. soft drink business, Coca-Cola has been slow to invest outside of its soft drink business. Instead of restlessly pulling away from the competition, Coca-Cola sat on its laurels -- exactly what Buffett warned the company not to do.

Even though both companies have long and storied histories, both of them need to adapt to the consumer environment. In an interview with the New York Times, marketing consultant Martin Lindstrom said that having your first Coke was once a rite of passage, but now parents are concerned about the health effects of introducing their children to soft drinks so the generational hand-off has broken down.

Moreover, Lindstrom says young people are more interested in energy drinks than they are in carbonated soft drinks. Adults drink Coke to feel young, but young people prefer energy drinks. Lindstrom's surveys indicate that the younger generation does not like highly carbonated beverages. This poses a problem for Coke, which is about twice as carbonated as energy drinks.

The solution, of course, is simple. Coca-Cola and PepsiCo need to continue promoting their soft drink brands, but invest in trending categories that may also be durable. Coca-Cola's deal with Green Mountain Coffee Roasters is a step in the right direction, as this gives the company a new channel for distributing its soft drinks. However, the company needs to get in front of bigger trends, like energy drinks, and invest heavily.

Foolish takeaway
Coca-Cola and PepsiCo have the resources to dominate the beverage market for another century; they simply need to execute. PepsiCo is off to a good start with its healthy products portfolio, but it cannot give up on its soft drink business just yet. Coca-Cola, on the other hand, needs to rid itself of complacency and make significant investments in non-soft drink categories. If both companies shed their complacency and face reality, their shareholders have a lot to gain.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.