Shares of home goods retailer Williams Sonoma (WSM -0.84%) rallied 28.2% in November, according to data from S&P Global Market Intelligence.

Williams-Sonoma reported third quarter results on Nov. 20, with shares skyrocketing in the aftermath, accounting for most of the month's gains. While headlines results didn't seem like much to cheer about at first glance, they were well above expectations, with Wall Street cheering management's navigation of a tough consumer spending environment.

Revenues decline, but margins go up

Williams-Sonoma is a specialty retailer that owns several high-end home goods brands, including its Williams-Sonoma namesake, Pottery Barn, Pottery Barn Kids, West Elm, and Rejuvenation. As has been the case with virtually every discretionary and home goods retailer, Williams-Sonoma has seen sales declines amid the post-pandemic inflation following the home goods boom during the pandemic.

At first glance, investors might be confused as to why the stock was up so much after seeing the numbers, After all, revenue declined 2.9% to $1.8 billion, with comparable-store sales down a similar amount.

Yet while revenue was down, the reported number still came in ahead of analyst expectations. Meanwhile, Williams-Sonoma was actually able to grow earnings per share by 7.1% in the quarter to $1.96, which also came in ahead of Wall Street's expectations.

The impressive profit growth came as a result of higher gross margins, which expanded from 44.4% last year to 46.7%. Additionally, the company lowered its share count by repurchasing $533 million worth of stock in the quarter, increasing the year-to-date repurchase total to $707 million. Not only did repurchases ramp up, suggesting optimism on the part of management, but Williams-Sonoma's board of directors also authorized another $1 billion share repurchase program on the earnings release.

Management also gave strong guidance, at least on a relative basis relative to prior figures. Williams-Sonoma now sees full-year revenues down between 3% and 1.5% for the full year, which would be an improvement over the third quarter, and sees operating margins improving by 40 basis points relative to the prior outlook.

Williams-Sonoma is allocating capital well

Amid the downturn in home goods sales, Williams-Sonoma appears to be strategizing well. Understanding the importance of preserving its brand power and its debt-free balance sheet, the company appears to be maintaining or raising prices to grow gross margin at the sacrifice of volumes and revenue growth.

Clearly, investors are cheering the strategy and execution, as well as the generous shareholder returns. That being said, shares now seem to reflect an anticipation of a recovery in the year ahead, as they trade for 22 times earnings. While not overly expensive, that figure does seem to anticipate a better consumer spending environment in the future. After all, one can't generate earnings growth by raising prices exorbitantly or cutting costs forever.