According to Blackbox Intelligence, third-quarter sales and traffic for the restaurant industry in the U.S. were weak. Industrywide same-store sales, or comps, were a negative 0.2%, representing a 0.6% drop from the second quarter. This signifies that the sluggish environment faced by the restaurant industry is continuing, as three out of the last four quarters have shown decreases in same-store sales .

This industrywide trend is understandable because cash-strapped consumers prefer spending less on eating out as opposed to cooking at home. Amid such a tough scenario, The Cheesecake Factory's (CAKE 3.41%) third-quarter results were quite surprising. The company reported consolidated comps growth of 0.8%.

This was the 15th consecutive quarter of positive same restaurant sales for Cheesecake Factory. This is remarkable considering the environment Cheesecake Factory is operating in. That being said, the growth at Cheesecake Factory was, however, minuscule when compared to 6.2% growth at Chipotle Mexican Grill (CMG 1.07%) and 1.7% growth at Panera Bread (PNRA).

CAKE Chart

CAKE data by YCharts

However, of the three, Panera has suffered the most as we see in the chart above. We shall delve into the reasons behind this in some time. Before that, let's take a closer look at Cheesecake Factory.

Cheesecake's performance
Cheesecake Factory's comps grew within the guided range of flat to 1%, and this led to revenue growth of 3.5% year over year to $469.7 million . Analysts had expected $469 million. Despite an improvement in gross margin due to favorable food costs, operating margin in the third quarter fell 50 basis points, or bps, year-over-year to 8.2% due to higher operating costs. The company reported a 6.1% year-over-year jump in adjusted earnings, which came in at $0.51 per share.

At the end of the third quarter Cheesecake Factory operated 176 restaurants, which included two new ones that were added during the quarter. Going forward, it plans to open nine new company-owned restaurants versus its prior guidance of eight to 10 openings. Internationally, Cheesecake Factory plans to open three to five restaurants in the Middle East and Mexico under licensing agreements this year.

The Cheesecake Factory is investor friendly. During the third quarter, the company bought back 2.1 million shares of its common stock at a cost of $90.2 million. It has repurchased 3.4 million shares in the first nine months of the year for $135.5 million. During the fourth quarter, the company targets to spend as much as $65 million for share repurchases. This is an additional $30 million of capital allocation compared to its previous guidance.

After a disappointing second quarter, The Cheesecake Factory posted good third-quarter results and this is an encouraging sign in a depressed industry. The share repurchase will also instill a lot of optimism in investors and this is evident from the way the share price has been climbing.

Panera and Chipotle -- Two different stories
As compared to The Cheesecake Factory, Panera Bread has struggled after its third-quarter results. Panera has missed analysts' estimates on comps for three successive quarters. In third quarter, it missed revenue estimates and its own guidance on comps while also reducing its earnings guidance.

Analysts do not expect much growth from Panera. The gap between Panera's trailing P/E of 24 and forward P/E of 21.7 is not significant. Hence, investors should consider other alternatives, as Panera doesn't look like a good bet at current levels and management isn't too sure about how the company might perform going forward as it withheld its fiscal 2014 guidance.

On the other hand, Chipotle Mexican Grill has been on a roll. Its shares have recorded year-to-date gains of more than 75%. Chipotle has seen comps increase in the last three quarters -- 1% in the first quarter, 5.5% in the second quarter, and 6.8% in the previous quarter . Fueled by strong traffic, Chipotle's sales increased 18% versus the same quarter last year to $826.9 million , beating analyst estimates. The company also reported a 17.2% year-over-year jump in earnings to $2.66 per share.

Going forward, I feel that Chipotle's GMO-free initiative will lead to good results as consumers are becoming conscious about healthy eating. In addition, with new menu items implemented across its entire chain, Chipotle should see higher sales. On the back of strong third-quarter results, Chipotle increased its comps guidance for 2013, signifying better times ahead.

Final words
Cheesecake has done well this year in a tough environment, and so has Chipotle. Cheesecake's results improved in the previous quarter and management has been returning cash to shareholders through repurchases. Also, Cheesecake Factory also pays out a dividend that yields 1.20% annually. It is also cheaper with a trailing P/E of 25 when compared to Chipotle's expensive P/E ratio of 54.21.

Conservative investors should consider Cheesecake for their portfolios since the company isn't too expensive, it is delivering value to shareholders, and its earnings are expected to grow at a compound annual growth rate of 13.9% over the next five years.