What happened

Shake Shack (SHAK -0.56%) climbed 41% last month, according to data from S&P Global Market Intelligence as the fast-casual burger chain bounced back from a weak earnings report at the end of July, and gained on an analyst upgrade and bullish sentiment for fast-food stocks.

As you can see from the chart below, the stock climbed steadily through August and then surged at the end of the month on enthusiasm about a new rapid COVID-19 test that could bring back restaurant customers.

SHAK Chart

SHAK data by YCharts

So what

There was little news out on Shake Shack in the first half of the month, but the stock seemed to gain as coronavirus cases nationwide pulled back from a peak in July, boosting hopes for a continued economic reopening that would help Shake Shack, which has been battered by a loss of office workers and tourists. Stocks also climbed broadly on a strong quarterly earnings report and economic data that showed the recovery moving along.

A Shake Shack burger in a paper wrapper

Image source: Shake Shack.

On Aug. 20, Shake Shack stock kicked off an 8% gain over a two-day span after Wedbush analyst Nick Setyan upgraded the stock from neutral to outperform and lifted his price target from $53 to $77. Setyan noted that Shake Shack had been one of the best growth stocks in the restaurant industry before the pandemic, and said that the earlier sell-off this year added to the stock's growth potential. He was also encouraged by the company's recent digital investments and new unit formats like drive-thrus.

Finally, the stock surged in the last week of August along with a number of restaurant chains after Abbott Labs said it was developing a rapid COVID-19 test that would give results in just 15 minutes and cost only $5. The test could help better control the spread of the virus, and possibly bring back restaurant traffic as eateries would have a convenient tool to screen customers.

Now what

There's no question that Shake Shack has a big hole to dig itself out of after revenue tumbled by 40% in the second quarter. The company is in a weaker position than many of its fast-food rivals because its stores are located mostly in cities and reliant on walk-in traffic, rather than digital sales or drive-thru orders.

Still, Shake Shack restaurants generate more sales per location than almost any other fast-food chain, and the brand remains strong. The company's performance should recover as consumer behavior normalizes.