What's the best way to build wealth and get rich in the stock market? Contrary to what you may have heard, it isn't by speculating on penny stocks, day trading, or any other risky method.

The right way (and the most reliable way) to "get rich" with stocks is to invest in rock-solid businesses and hold them for as long as they remain rock-solid businesses. Here are three in particular that both new and experienced investors may want to take a closer look at.

This payments stock is truly a cash machine

PayPal (PYPL -0.31%) is a massive business, with 429 million active accounts and over $1.2 trillion in annualized payment volume. It's also one of the worst-performing stocks in the S&P 500 index, with shares down by more than 60% so far in 2022.

To be fair, there are some good reasons. PayPal's recent active user growth has been disappointing, and the company has conceded that its growth targets (the company had been aiming for 750 million users within a few years) were unlikely to happen. Instead, PayPal is shifting its focus to monetization of its current user base.

While this was certainly disappointing for investors, it's important not to overlook what a powerhouse business this is. PayPal is the clear leader in online payments and continues to grow impressively, with 15% year-over-year revenue growth in the first quarter in its core business. The average PayPal user made 47 transactions in the quarter, 11% more than a year ago. And PayPal is an absolute cash machine, with over $5 billion in free cash flow annually and tremendous flexibility to invest in its own growth.

A compounding machine with a stellar track record

I've called Realty Income (O 0.36%) perhaps the best overall dividend stock in the market, and for good reason. The real estate investment trust, or REIT, has paid 624 consecutive monthly dividends to its shareholders, and has increased the payout for 99 quarters in a row at an annualized growth rate of 4.4%. And it's not just an income play -- Realty Income has delivered a stellar 15.3% average annual return since its 1994 New York Stock Exchange listing.

Realty Income invests in single-tenant properties, mostly occupied by retail tenants. As of the latest information, the company owns more than 11,200 properties in the U.S. and Europe.

Don't be worried by the word "retail." Most of Realty Income's tenants are businesses that are recession-resistant, as well as resistant to e-commerce headwinds. Just to name a few, Walgreens (WBA -0.09%), Dollar General (DG 0.14%), FedEx (FDX 0.30%), and Walmart (WMT -0.13%) are among Realty Income's top tenants. This is a high-yielding dividend growth stock that has done a great job of creating wealth for long-term shareholders.

An entertainment powerhouse with trillion-dollar potential

To be sure, Disney's (DIS 0.83%) business suffered because of the pandemic, with its theme parks and cruise lines shut down or limited for much of 2020 and 2021, and with movie theaters unavailable to show its blockbuster films. And its theme parks in Asia remain affected.

However, Disney's core business has come roaring back. As I write this, reservations for at least one of its Walt Disney World theme parks are sold out on six of the next seven days. Its movie franchises are back in business. And Disney's merchandise sales and cruising business are strong as well. Plus, with stellar subscription growth from the Disney+, Hulu, and ESPN+ streaming services, Disney has created a massive recurring revenue stream that was virtually nonexistent before the pandemic (Disney+ launched in late 2019).

Disney's business is stronger than it was before the pandemic, and it should get even stronger as its streaming business evolves. And its stock is trading close to its five-year low.

Buy for the long haul

All three of these are incredibly solid businesses with profitable operations and long track records of success and growth. However, there are some serious economic headwinds right now, and it would be wise to expect volatility to continue for a while. I'm confident investors who buy these will be glad they did in a decade or so, and I own all three in my portfolio, but expect some turbulence in the meantime.