FORTUNE -- McDonald's performance over the past couple of years is often characterized as a classic recession success story: Strapped or worried consumers always flock to fast-food joints during hard times, hunting bargains, the theory goes, so of course McDonald's has done well. But while it's certainly true that the company has benefited from the downturn, that's only part of the story, and a relatively small part at that.
Consider that McDonald's (MCD, Fortune 500) has done well throughout the recession- both when the economy was contracting and when it was expanding, as it is now (albeit anemically). On Monday, McDonald's announced that same-store sales rose 7% globally in July over the previous year (and an eye-popping 10.1% in the non-American, non-European parts of the world). The global increase is the biggest such gain since January 2009. But the company has also reported big increases during some of the recession's worst months.
McDonald's success can be summed up like this: the fast food chain has given more kinds of people more reasons head to its stores throughout the day, buying an ever-wider range of products. It is no longer just a place for young men to grab large, cheap mounds of food to scarf down for breakfast, lunch or dinner. It is also a place for a mom to pick up the family's evening meal, for a young woman to acquire a cold smoothie on her way home from work, or for a busy executive to grab a tasty cup of premium coffee on his way to a midmorning meeting-perhaps lingering to check his email via McDonald's free wi-fi service, introduced in January.
The secret is in the cup
McDonald's attributes July's sales increase to the popularity of its new frappes (basically a coffee milkshake) and fruit smoothies. It's been a hot summer, generally, around the world, the company noted in its earnings report. But it's also been a summer filled with McDonald's advertisements for the recently introduced cold drinks-which some observers had warned could be big losers. In June, the trade publication Brandweek pointed out the overlooked fact that rates for local television advertising are down. McDonald's has taken advantage of this, mounting an ad blitz for its new products without having to increase its ad budget by much.
Frappes and smoothies have done so well, in fact, that their success has obscured one of the chain's few weak spots: Sales of hot beverages at the chain's new McCafe coffee bars-the supposed Starbucks-killers-have taken a serious nosedive. In June, Crain's Chicago Business reported that it had gotten hold of internal data showing that over the year since McCafe began offering its line of premium coffee drinks, sales volume fell from about 55 drinks per unit per day to about 25. At this point, frappes are doing way better than lattes. But even here, the news isn't all bad. Beverages yield enviable margins, and offering premium coffee drinks helps McDonald's bolster its image, an overall company goal. And besides, sales could turn around again.
McDonald's didn't mention hot beverages on Monday when it announced its July sales figures. But the company did note that the new cold drinks weren't the sole driver of the increases. "Core products and McDonald's all-day, everyday value menus were also key," the company said in a statement.
They have been key all along, as McDonald's has diversified its menu and its pricing in order to diversify its customer base. So while hungry young men with disposable income are still heading to McDonald's for its 1/3-pound Angus burger, more value-conscious customers are flocking in for Chicken McNuggets, Value Meals, or the new Breakfast Dollar Menu. The company cited the latter item in July when it announced yet another stellar quarter: profits up by 12 percent and revenues up by 5 percent.
Next up for the company is a renewed focus on the battle for the morning. With Subway and Taco Bell among newcomers to the first meal of the day, the home of the Egg McMuffin is bolstering its own offerings. Breakfast already makes up about a quarter of the chain's sales, but it's widely expected that oatmeal, which has already been successfully test marketed, will be added to the menu next year.
Besides potentially attracting more breakfast customers, oatmeal should help the chain strengthen its roster of "healthy" options. And as with all fast food, perception is more important than reality. The sugar-laden, high-calorie fruit smoothies that are selling so well are perceived by many consumers as being healthy because they're made from fruit-a misperception that McDonald's doesn't do much to rectify. And for some of its kid-centric Happy Meals, the chain has lately begun offering the option of replacing fries with fruit. Altogether, the efforts to appear healthier could attract some of the people who avoid McDonald's because of its reputation as a peddler of sugar, fat, and grease.
McDonald's has been dinged before for trying too hard to diversify its lineup of food, and overtly appeal to different customers, as with its "grown-up" Arch Deluxe flop. This time around, it's focusing less on the type of customer it wants to have, and more on giving customers who choose McDonald's options that they really want.