McDonald's (MCD -0.42%) and Chipotle Mexican Grill (CMG 6.33%) are direct rivals in the restaurant industry. Chipotle has been the clear winner over the long term, as the company has materially outperformed McDonald's due to booming demand for its Mexican food made with fresh and natural ingredients.

But the tables have turned lately, and McDonald's stock is up by over 25% year to date on the back of encouraging sales data, while Chipotle stock has lost over 20% in the last quarter due to growing concerns about the E. coli cases linked to the company. 

Which one is a better buy at current prices: Chipotle or McDonald's?

McDonald's
McDonald's has been facing stagnant or even declining revenues since 2013. With over 36,400 stores across 125 countries, it's not easy for such a gigantic company to find growth opportunities in a mature and competitive industry. Besides, consumers around the world are increasingly inclined toward healthier nutrition, and McDonald's is not particularly well positioned when it comes to calories and overall health considerations.

Still, the company is making material progress under the leadership of Steve Easterbrook, who assumed the CEO position in March of this year. McDonald's is revamping both its menu and operations, closing unprofitable stores, and betting on menu innovation to jump-start growth. While it's too early to tell for sure, things seem to be improving for the fast-food juggernaut.

The company reported encouraging sales data for the third quarter of 2015. Global comparable sales increased 4% year over year, and comparable sales in the U.S. increased for the first time in the last two years, rising by a modest 0.9%. Importantly, management believes comparable sales in the fourth quarter will remain on positive ground. 

Transformations are seldom easy, and one quarter of positive sales data does not make a trend. But McDonald's seems to be moving in the right direction, and this is a big positive for investors after years of disappointing performance.

Chipotle
Chipotle Mexican Grill is the poster child of the fast-casual revolution, referring to restaurants offering the same speed and relaxed atmosphere of traditional fast-food chains, but serving higher-quality ingredients in exchange for a few extra bucks. Consumers fell in love with Chipotle's proposition over the last several years, especially millennials and young customers, a crucial demographic segment in the industry.

The company was making only $1.8 million in revenue back in 2010. Fast forward five years, and analysts are forecasting $4.7 million in sales for Chipotle during 2015. Based on data for the third quarter, the business continues to outperform most competitors, as Chipotle announced a 15.3% increase in revenue for the first nine months of 2015.

But Chipotle has been losing its flavor lately. Federal health officials are investigating an E. coli outbreak that seems to be linked to 11 Chipotle restaurants in Washington and Oregon, and this is generating a lot of  concern among investors. 

The company has taken a broad series of measures related to food safety and sanitation. These include a deep cleaning at the restaurants linked to the E. coli incident, replacing ingredients in those restaurants, and changing food preparation procedures. In addition, Chipotle is planning on expanding its testing of key ingredients, examining all of its food-safety procedures, and working with two food safety scientists to assess its food safety programs across the board.

According to a recent press release from Chipotle, "the source of the problem appears to have been contained during a period in late October," so maybe the worst is over in terms of stopping the E. coli outbreak. On the other hand, we still don't know how much damage this incident will inflict on Chipotle's revenues over the middle term.

Which one is a better buy right now?
With a market capitalization around $105 billion, McDonald's is a much bigger and more stable business. Besides, the stock pays a dividend yield of around 3.1%, while Chipotle pays no dividend at all. If you are looking for stability and current income, then McDonald's could be the right choice.

On the other hand, Chipotle has a much smaller restaurant base of 1,931 units as of the third quarter, and the company's market value is in the neighborhood of $18 billion. In terms of revenue, Chipotle is approximately 20% the size of McDonald's. This means Chipotle has far more room for growth over the years ahead, even if performance remains under pressure due to the E. coli incident in the short term.

Chipotle is a high-quality business with plenty of potential for growth, and buying these kinds of companies in times of temporary weakness is generally a good recipe for mouthwatering returns. On a time horizon of three years or more, Chipotle will probably deliver tastier returns than McDonald's.