Buying shares of strong companies when they are on sale is an effective strategy for building wealth in the stock market. Even the best companies in the world have trouble avoiding weak sales in a recession, but investors who stay focused on the long-term value of these businesses will come out ahead.

Three Motley Fool contributors were recently asked to provide information on three top stocks trading at bargain valuations that could see their stock prices soar over the next several years. Let's see why they like Roku (ROKU -10.29%), RH (RH 2.28%), and Williams-Sonoma (WSM 0.17%).

This stock might be the best bargain in streaming

Jennifer Saibil (Roku): The streaming industry exploded over the past few years, but it looks like the high-growth stage is winding down. That leaves several companies competing for the same subscribers while trying to raise prices enough to cover the increased costs of content production.

Roku has a somewhat different model from the average streaming platform, and that gives it an edge. For example, Roku sells hardware used to organize all the streaming channels and aid users. For another, its platform operating system is sold with most smart TVs these days and helps it maintain the top spot among streaming platforms. The hardware segment faced rough times when supply chain problems cropped up in late 2021 and 2022, but it got back to growth in the 2023 first quarter.

Roku's hardware segment isn't even its biggest business. It's platform operations collect fees from other services using the platform, but also from ad revenue on the platform and on its own original free video-on-demand streaming service. As advertisers shift over to streaming, Roku is benefiting. The platform business was its faster-growing business until this year. In the 2023 first quarter, platform ad sales fell 1% year over year, while total revenue increased 1%, due to the growth in devices.

Advertisers are feeling the pressure of inflation and cutting back on spending, and this trend may not reverse until the economy fully recovers. Overall U.S. industry sales decreased 7.4% in the quarter, so Roku will be negatively impacted, as well, in the near term. However, it's working to monetize its channel with some innovative solutions, such as working with advertisers to promote specific content.

Other metrics indicate that Roku is still popular with viewers, though, and that's a positive signal for the long term. Active users in Q1 increased to 71.6 million, up 17% year over year, and viewing hours increased 20%.

Roku's stock skyrocketed during the pandemic, but fell back to Earth in 2022 along with many other hyped tech stocks. In 2023, investors who saw the incredible opportunity pushed the stock price up nearly 60% so far this year. But even with this year's growth, shares are still a bargain trading at 2.9 times trailing-12-month sales.

Roku has massive potential, and now is a great time to buy.

An undervalued luxury brand

John Ballard (RH): This isn't a good year to be in the luxury furnishings business. RH stock is up about 300% over the last 10 years but has fallen well off its previous highs.

Demand for furniture just isn't there in 2023, and that's reflected in the company's recent weak financial results. However, the RH brand is well-positioned for long-term growth. With the stock trading at a deep discount, now could be a smart time to buy.

In its most recent quarter, RH reported just $739 million in revenue, compared to $957 million a year ago. That translated to lower profits, where its industry-leading operating margin of 21% in the year-ago quarter fell to 13% in the most recent quarter. Management anticipates the macroeconomic challenges will weigh on results throughout this year and into next year.

Why buy the stock? For the same reason that real estate investors in California made a fortune buying undervalued properties during high inflation in the 1970s. Consumers will undoubtedly be shopping for luxury furniture again, but the market's focus on weak sales in the near term means investors can buy a share of RH for just 13 times what it earned in profits a few years ago. You won't get it this cheap when furniture sales are growing.

Under CEO Gary Friedman's leadership, RH emerged as a lifestyle brand. It has dozens of collections tailored to different design concepts and interiors, ranging from contemporary to modern to outdoor to baby and child. The company is also in the early innings of growing internationally, where it recently opened a new gallery in England at the Historic Aynho Park.

These initiatives should power the company's revenue over the long term. In fact, management sees a multibillion-dollar opportunity ahead. 

It's difficult to say whether this luxury stock has hit bottom or will reach new lows again this year. The markets are always unpredictable in the short term, but buying the stock while it's trading at cheap prices makes a lot of sense if you can afford to hold your stocks for at least five years. That should give the business plenty of time to recover and be rewarded with the valuation it deserves.

A timeless home furnishings company

Jeremy Bowman (Williams-Sonoma): The post-pandemic economy has hit home furnishings stocks hard. The sector boomed during the global health crisis as consumers spent more time at home, leading them to buy more furniture and spend on other at-home trappings. Now that the crisis is over, consumers have shown a preference for spending money on services they were denied during the pandemic, like travel, restaurants, and entertainment.

That trend won't last forever. It will eventually normalize, and when it does, Williams-Sonoma looks like a great stock to have in your portfolio. 

The company also owns West Elm and Pottery Barn and has one of the best track records in retail. It's been around for more than 60 years and built a collection of premium, aspirational brands that allow it to generate above-average profit margins. Its operating margin hovers around 15%.

The company was also ahead of the curve with its shift to e-commerce, as roughly two-thirds of its sales now come from the digital channel. That's allowed it to cut costs and save money by rationalizing its store count.

After a boom during the pandemic, the retailer faces difficult comparisons with its performance last year and expects flat revenue growth for the year. However, over the long term, the company expects to deliver mid- to high-single-digit annual revenue growth and an operating margin above 15%.

When you combine that with a steady flow of share buybacks and a dividend yield of 3%, Williams-Sonoma should deliver solid returns for investors. Meanwhile, the stock trades at a price-to-earnings ratio of just 8, and that multiple is likely to expand once the company's growth rate improves.