What happened

Shares of Boston Beer (SAM 0.77%) outperformed the market this week, as the stock gained 11% through Thursday trading compared to a 3.3% rise in the S&P 500, according to data provided by S&P Global Market Intelligence. The spike closed the gap between the beer producer's returns and the index's returns this year, but shares are still down over 30% so far in 2022.

The rebound was powered by a general uptick in investor optimism following deep pessimism in recent weeks.

So what

The main factor driving Boston Beer's shares higher has been the market's broader recovery. Stocks posted sharp gains through Thursday trading after declining through most of 2022. Boston Beer has been hit even harder, with shares down 67% in the past full year compared to an 11% drop in the S&P 500 in that time. It is no surprise that the deep pessimism embedded in that decline would set the stage for market-beating performances during a wider rally in the stock market.

There are some good reasons to believe in Boston Beer's business rebound, too. Management said back in late April that its inventory situation had improved and that market-share gains are accelerating in key parts of the business. Sure, sales are still falling overall as consumers continue moving away from the hard seltzer niche and the Truly brand. But Boston Beer could be past the worst of its sales hit from that shift.

Now what

The proof of that stabilization might come in the company's next earnings report, which is set for July 21. Management at that time will update its 2022 outlook that currently calls for depletions, a measure of consumer sales, to rise by between 4% and 10% this year as gross profit margin falls to between 45% and 48%.

The rally in the stock price this week implies that at least some investors see room for those targets to be raised (or at least met) in 2022.