Nearly every business related to the housing market has struggled lately. That includes businesses connected to real estate transactions like Redfin and Opendoor Technologies, home improvement retailers like Home Depot and Lowe's, and residential REITs like Invitation Homes.

Mortgage rates have remained elevated even as the Federal Reserve has begun lowering its benchmark rates, and existing home sales are well below pre-pandemic levels due to higher mortgage rates and the lock-in effect of low mortgage rates during the pandemic.

This combination of factors has led to stiff headwinds in the housing and home products industry, but one stock has bucked the trend. That's Williams-Sonoma (WSM 3.12%), the high-end home furnishings retailer and parent of brands like West Elm and Pottery Barn.

Even as revenue has declined this year, the retailer has grown its bottom line by making improvements in the business and the cost structure, and it continues to return capital to shareholders through dividends and share buybacks.

The stock jumped 27.5% on Wednesday after the company easily beat expectations in spite of the broader headwinds in housing as its results blew away expectations.

Williams-Sonoma reported a comparable sales decline of 2.9%, and revenue was down 2.9% to $1.8 billion, which edged past estimates of $1.78. What really impressed investors was the margin improvement, as gross margin rose from 44.4% to 46.7% due to higher merchandise margin and supply chain efficiencies. It also lowered its occupancy costs, making the percentage costs on occupancy flat.

Selling, general, and administrative expenses rose 150 basis points to 28.9% due to higher employment and advertising expenses. Combining those two line items, operating margin rose 80 basis points to 17.8%, and operating income increased by 1.8% to $320.6 million. On the bottom line, generally accepted accounting principles (GAAP) earnings per share rose 7% from $1.83 to $1.96, ahead of the consensus of $1.77.

Williams-Sonoma also improved its guidance in the quarter, calling for a revenue decline of 1.5% to 3%, versus a previous range of a 3% to 4.5% decline. It also raised its unadjusted operating margin guidance to between 18.4% to 18.8%, and the company continues to target mid- to high single-digit revenue growth and operating margin in the mid- to high teens over the long term.

Two people shopping in a home furnishings store.

Image source: Getty Images.

Williams-Sonoma's secret sauce

Management continues to expect weakness in the housing market into 2025, but the company is making improvements to the business where it can. Its biggest achievement in the third quarter was expanding its gross margin by 230 basis points, which it achieved through lower input cuts and sticking to full-price sales. Management also stressed newness across multiple categories, meaning its products continue to bring in and excite customers despite the broader headwinds in the sector. The company is reducing its promotions, which CEO Laura Alber said was good for customers because they can trust their prices and not feel like they need to wait for a discount.

Supply chain efficiencies were also a key factor in the better-than-expected profit, and the company said it's prepared for any tariffs that the next administration enacts as it's reduced its sourcing from China and does a significant amount of its manufacturing in the U.S. Additionally, its trade business was up 4% in the quarter, and B2B business is gaining traction as well. Management noted that B2B is an $80 billion opportunity in home furnishings, and it sees a huge opportunity there.

Overall, Alber has prioritized operating income above sales growth or another metric, and that strategy is paying off for investors.

Is Williams-Sonoma a buy?

Alber also touted the company's achievements in operating margin in a down sales environment and referred to the business as a "coiled spring" when furniture sales start to rebound.

Nobody knows when that will happen, but it will bounce back at some point. For now, Williams-Sonoma is clearly executing well in the environment it's faced with, and it seems on track to deliver continued operating margin improvements. Additionally, the company just approved a new $1 billion share repurchase authorization, giving it $1.3 billion to buy back stock with the remainder from the last authorization.

The stock now trades at a price-to-earnings ratio of 21, and it looks well priced, considering its strong execution in a difficult environment. If Williams-Sonoma maintains its momentum, the stock is likely to surge when the housing market finally turns.