The stock market has had a rough go of it this year. In the first half of 2022, the S&P 500 index fell 20.6%. That's its worst six-month performance to open a year in over half a century. Year to date, the index is down 25%, putting it firmly in bear market territory.

But every bear market since 1928 has been followed by a recovery. Buying shares of outstanding companies whose shares have been beaten down by a bear market can produce market-beating returns and make investors richer in the long run.

Buying stocks when everyone else is selling can be a mental challenge. Those who can overcome the internal barrier and buy ahead of the recovery will likely have an incredible story to tell when the market recovers. As Warren Buffett famously once said, "When it's raining  gold, reach for a bucket, not a thimble."

Johnson Controls' technology will surprise you

Johnson Controls' (JCI 1.02%) high-efficiency heating and air-conditioning units play a critical role for customers like fast-growing data centers, significantly reducing energy costs and keeping tenants happy. For example, data center companies need to keep a massive amount of computer hardware cool, healthcare facilities need to keep patients warm and medicines at their optimal temperature, and apartment buildings need to keep residential customers comfortable. At the same time, Johnson Controls' energy-efficient units reduce greenhouse gas emissions and enable customers to meet increasingly stringent energy conservation regulations.

In addition to selling into growing industries like data centers, Johnson Controls is rolling out OpenBlue, its newest Internet-of-Things platform. OpenBlue remotely monitors equipment for preventative maintenance and warns customers before failures occur. The service is quickly becoming a vital service for grocery chains, pharmaceutical companies, and data centers that need cooling. Otherwise, they face the risk of massive spoilage or hardware breakdown costs.

Moreover, OpenBlue is system-agnostic, meaning it can be attached to any heating and air-conditioning unit on the market. Therefore, Johnson Controls can take business from competitors by selling its replacement parts to their units.

Johnson Controls stock has retreated 39% from its 52-week high based on fears of a slowing economy, which could hinder new construction. But the company has an $11.1 billion backlog of orders.

Chart showing Johnson Controls' backlog.

Image source: Johnson Controls company presentation.

Despite the current macro environment, the company still expects to generate organic revenue growth of 8% to 9% and adjusted earnings per share of $2.98 to $3.02 this year. Given the company's adjusted earnings per share forecast, the stock is trading at a forward price-earnings (P/E) ratio of 16.7. That's an attractive price for a stock with Johnson Controls' growth potential.

Deere's autonomous tractors could quickly grow

Deere & Company (DE -0.18%) and its famous green and yellow brand have dominated the U.S. tractor and combine markets. Deere commands 53% of the tractor market and 60% of the combine market at home, but less internationally.

Deere's premier autonomous tractor will be rolled out as a GPS-guided version of the R8 model this fall. The tractor includes 12 cameras that will enable 360-degree obstacle detection. The cameras and GPS run in tandem with a geofence that operates the tractor within an inch of accuracy.

Deere is investing in the software that runs its autonomous tractors and can also be used to run traditional tractors without a driver. The software carries an 85% gross margin compared to around 25% for equipment. Deere projects that software subscriptions will make up 10% of its revenue by the end of the decade.

International competitors CNH Industrial and AGCO are also working to bring their versions to market. AGCO said it will begin marketing them sometime in the next five years, while CNH doesn't have a timeline for its autonomous equipment. Deere, on the other hand, expects to begin selling its autonomous tractors this fall and to sell autonomous models of its entire equipment line by 2030.

While international competitors stand flat-footed, Deere's first-mover advantage can enable it to take an increasing share of the international market over the next several years. Yet, the stock is down 24% from its 52-week high and trades at a P/E ratio of about 17. That's a more compelling bargain than the stock has seen in over two years.

Watsco dominates its industry

Watsco (WSO -0.18%) is an under-the-radar company that sells replacement parts for air-conditioner units to local repair companies through its massive distribution network. The company has made $804 million in acquisitions to bolster its product portfolio and expand its network since 2001. Watsco has made a practice of quickly and efficiently upselling newly acquired products into its sprawling U.S. distribution network. The results have been unbelievable. 

Chart showing 20-year statistics for Watsco.

Image source: Watsco company presentation.

Watsco's industry is highly fragmented, meaning it is made up of a large number of smaller competitors. The company plans to repeat its proven acquisition strategy for the foreseeable future.

More recently, Watsco has implemented an e-commerce platform that allows field technicians to order replacement parts faster than traditional channels. The platform enables its repair company customers to complete more jobs per day and become more profitable. The platform also allows for easier integration of future acquisitions.

Watsco's stock is one of only 29 to achieve a 20% annualized total return over the last 30 years. But today's bear market has caused it to come down 22% from its 52-week high. The stock now trades at a P/E ratio of 19.4, dramatically more appealing than its five-year average of nearly 30.

Buy now or wait?

There is no telling when today's bear market will give way to the bulls. But the stock market is always forward-looking. So, waiting for rosy macroeconomic news may mean the recovery is already upon us. Buying the stocks of great companies at depressed prices is a recipe for market-beating returns. Even if it means the bear market persists for a while, it's better than suffering from the regret of missing out on opportunities like these.