People aren't splurging in categories that they had prioritized during the pandemic, and this shift is hurting retailers like Home Depot (HD 0.94%) and Tractor Supply (TSCO 3.26%). Both companies recently reported modest sales declines heading into late 2023.

Yet the slump isn't threatening the long-term outlook for either business. Home Depot sees a long runway for growth ahead in the home improvement market, and Tractor Supply isn't abandoning its ambitious store expansion plans, either.

So let's look at the two beaten-down stocks to see which is the better buy right now.

Low expectations

Neither company is putting up impressive growth metrics today. Home Depot reported a 2% drop in comparable-store sales in mid-August while citing weaker demand in many home improvement categories. In late October, Tractor Supply announced flat comps as its rural lifestyle shoppers pulled back on big-ticket purchases.

Yet investors are punishing Tractor Supply's stock more heavily because of changing expectations. Home Depot affirmed its initial 2023 outlook, suggesting management has been appropriately conservative about the state of the market. Tractor Supply, meanwhile, has surprised investors by reducing its annual targets in each of the last two quarters. "Our sales performance was softer than our expectations," CEO Hal Lawton said in a recent press release.

Positive factors

It hasn't been all bad news for either company, though. Tractor Supply is winning market share in a shrinking industry, management estimates. Customer traffic isn't declining, either, as it has been for other retailers like Target.

And profitability is still on track to land at about 10% of sales this year, which is well above the rate that the company was posting before the pandemic. Earnings will be about $10 per share, according to the latest estimate, down only slightly from Tractor Supply's initial forecast of between $10.30 and $10.60 per share.

Home Depot is still projecting just a modest sales decline this year following several years of strong growth. Profit margin will land at 14% of sales despite big pressures like lumber price deflation, keeping the market leader well ahead of rival Lowe's. And then there's the steadily rising cash flows headed to shareholders via dividend payments and stock buybacks that will cushion your returns through a likely volatile market into 2024.

Outlook and price

The good news is that Wall Street's pessimism has sent both stocks' valuations to near multiyear lows, meaning there's low risk of overpaying for these solid retailing businesses. Home Depot shares are trading at 17 times earnings, down from a P/E ratio of 21 earlier this year. Tractor Supply is also available at a discount of 20 times earnings compared to the 25 times earnings that investors were paying back in May.

In my view, Home Depot is the better option here. Sure, sales trends could suffer for several quarters as the housing market sputters under the weight of high mortgage rates. But Home Depot has been through many downturns in the past, including a prolonged slump during the Great Recession.

It has emerged from each of these slowdowns as a stronger business that went on to set new sales and earnings records. Its dividend payment will help protect your returns while accumulating more shares during market downturns if you choose to reinvest the payouts. Tractor Supply will bounce back as well, but the ride is likely to be bumpier for the rural lifestyle retailer.