Is a recession coming? Ark Invest CEO Cathie Wood thinks that one has already arrived. Economists surveyed by The Wall Street Journal put the odds of a recession over the next 12 months at 44%. Federal Reserve chairman Jerome Powell recently said that a recession is "a possibility," although the Fed is trying to avoid causing one with its interest rate hikes.

Perhaps the best answer as to whether or not a recession is coming is... definitely maybe. The good news is that investors can be prepared. Here are three great stocks to buy if a recession is on the way (listed in alphabetical order).

1. Brookfield Renewable

What kinds of stocks hold up well during a recession? You can put those with steady and dependable revenue high on the list. Brookfield Renewable (BEP 0.92%) (BEPC 0.81%) is such a stock.

Actually, Brookfield Renewable is two such stocks. The company was originally formed as a limited partnership (LP) with its shares listed under the BEP ticker. A couple of years ago, it also organized as a corporation and listed shares under the BEPC ticker. This move was made to attract investors who didn't want to deal with some of the hassles of buying shares of an LP.

There's only one underlying company, though. And it's rock-solid. Brookfield Renewable ranks as one of the world's top providers of renewable energy. It operates hydroelectric, wind, solar, and storage facilities with a combined capacity of 21 gigawatts.

The demand for renewable energy will almost certainly continue to skyrocket for years to come. Brookfield Renewable is in a great position to capitalize on this opportunity with a development pipeline capacity of close to 69 gigawatts. The company expects to deliver long-term annual returns of between 12% and 15%.

2. Dollar General

Many consumers are forced to rein in their spending during recessions. This directly benefits discount retailers. That's why Dollar General (DG -0.59%) appears to be a great stock to buy if a recession is coming.

Dollar General has been in business for more than 80 years. It currently operates 18,356 stores in 47 states. Roughly 75% of the U.S. population lives within five miles of a Dollar General store. Those stores carry the kinds of products that are necessities -- including food, health and beauty aids, cleaning supplies, and more -- at everyday low prices.

Shares of Dollar General are handily outperforming the overall market so far this year. Skyrocketing inflation is already causing people to modify their buying, similar to what typically happens in a recession.

But Dollar General is poised to deliver solid growth even if a recession isn't in the cards. The company plans to open 1,110 new stores this year and remodel 1,750 existing stores. Dollar General is also expanding its frozen and refrigerated product offerings, a move likely to attract even more customers.

3. Vertex Pharmaceuticals

Any company that sells must-have products tends to perform well regardless of macroeconomic factors. Vertex Pharmaceuticals (VRTX 0.20%) certainly fits this bill. The big biotech markets the only approved drugs that treat the underlying cause of cystic fibrosis (CF).

Thanks to this monopoly, Vertex continues to generate strong revenue and earnings growth. Its cash position stood at $8.2 billion at the end of the first quarter of 2022. And the stock's performance in 2022 reflects this business success: Vertex's shares are up close to 30% year to date.

The company has plenty of room to grow in the CF market. Its therapies are currently used by a little over half of the 83,000 CF patients in the U.S., Europe, Australia, and Canada. Vertex thinks that securing additional reimbursement deals and winning regulatory approvals in younger age groups for its current therapies will enable it to capture most of the rest of this market. 

CF isn't Vertex's only opportunity, though. The company and its partner, CRISPR Therapeutics, expect to file for regulatory approvals of exa-cel later this year. The gene-editing therapy holds the potential to cure the rare blood disorders sickle cell disease and transfusion-dependent beta thalassemia. Vertex also has promising pipeline candidates targeting acute pain and APOL1-mediated kidney disease.

With its CF monopoly, strong pipeline, and growing cash stockpile, I think that Vertex is the best biotech stock on the market right now. I also view it as a great pick for investors seeking to potentially ride out a coming recession.