Image source: The Motley Fool.

The line that separates McDonald's (MCD -0.44%) and Starbucks (SBUX 0.47%) is starting to blur. There's a growing number of food options at Starbucks outside of its signature brews, and as much as it will pain many to admit it you can now get a wide array of coffee beverages at McDonald's.

The two companies are also starting to switch roles in terms of stock market leadership. A year ago we had McDonald's reeling from two years of negative comps, just as Starbucks was a market darling. That's not the case these days. Comps at McDonald's finally turned positive during last year's holiday quarter, and have remained there through the first half of 2016. The world's largest burger chain has now rattled off three consecutive quarters of positive comps, with the stock notching new all-time highs two months ago. 

Starbucks, on the other hand, has been surprisingly challenging. Just as McDonald's has turned its business around over the past three quarters, the baron of baristas has fallen short of Wall Street's sales targets in each of the past three reporting periods. Starbucks stock actually peaked late last year, just as the first of the three disappointing quarters was starting. 

A year ago it seemed as if Starbucks was the one with the improving fundamentals and momentum. So far in 2016, McDonald's is the stock that's trading slightly higher. Starbucks is showing a small decline year-to-date. 

The Starbucks stops here

The java giant is still in decent shape. Consolidated net revenues grew 7% to hit a record $5.2 billion in its latest quarter. Brisk expansion and a 4% uptick in comps helped fuel the top-line gain. Margins improved, culminating in adjusted earnings per share rising 17% since the prior year's second quarter.

There are now 24,395 Starbucks locations worldwide, and the company continues to eye opportunities to keep padding its store count. Starbucks is no longer the hot stock that routinely beats Wall Street's profit targets -- it has only beaten bottom-line expectations once in the past four quarters -- but there are worse fates than merely meeting analyst income forecasts.

Golden arches

The picture is slightly different at Mickey D's. Consolidated revenue actually posted a 4% year-over-year decline in the second-quarter results that it posted on Tuesday. There's no reason to panic. Foreign exchange fluctuations weighed on its top-line showing. Consolidated revenue fell just 1% on a constant currency basis. The only reason that revenue is going the wrong way is that it's been handing over company-owned locations to franchisees.

The refranchising efforts will naturally hold back sales, but that should be offset by improving margins and profitability. Global comps actually rose 3% for the quarter, in line with Starbucks' showing. Adjusted earnings per share climbed 13% in constant currencies. 

McDonald's has historically traded at lower multiples than Starbucks. It is trading at 22 times this year's projected earnings and less than 20 times next year's target. Starbucks fetches a multiple of 31 times this year's profit forecast and 27 times next year's mark. McDonald's dividend of 2.8% is also twice that of Starbucks and its 1.4% payout. 

In defense of Starbucks, it is the one growing faster. That's been true even now when market sentiment has shifted in favor of McDonald's. As the more expensive stock it may seem to be the one with more to prove, but it's actually McDonald's that needs to sustain its turnaround. It's not a coincidence that comps turned positive for the burger flipper during the quarter that it rolled out all-day breakfast. The real test will come later this year when its comparable sales will be stacked up against the prior year's positive showing.

If you believe that the turnaround at McDonald's will stick then it would be the better investment given the lower valuation and healthier distributions. However, the Starbucks brand is still the one that consumers associate with a premium product -- and that, at the end of the day, is something that investors will clearly pay up for in the future.