You may not like what I'm about to say, but history suggests a stock market crash or correction is pretty much inevitable following the monumental run equities have mounted from the March 23 low. In each of the past eight bear markets, there have been 13 corrections or crashes in total ranging between 10% and 19.9% (not rounded) within three years following a market bottom. This means every new bull market experiences one or two pretty sizable hiccups.

But there's good news. You see, every correction or crash in history has been a buying opportunity for long-term investors. There have been 38 official corrections since 1950 in the broad-based S&P 500, and every single one was eventually erased by a bull market rally.

The big question is: What stocks should you buy if the market crashes?

If you have, say, $1,000 that you won't need for emergencies or bills, then keep that money at the ready to buy these three stocks if the market plunges.

A paper airplane made out of a twenty dollar bill that's crashed and crumpled into a financial newspaper.

Image source: Getty Images.

Okta

No matter how the U.S. economy is performing, one high-growth industry that can count on consistent demand is cybersecurity. Hackers and robots don't take a day off just because the U.S. economy isn't running on all cylinders. This is what's made in-house network and cloud protection a basic-need service. It's also why Okta (OKTA 0.41%) can be on your buy list during steep declines in the stock market.

Okta is specifically focused on cloud-based identity verification solutions. With the coronavirus disease 2019 (COVID-19) pandemic transforming traditional work environments and more businesses pushing online, Okta has seen no slowdown in demand. Okta fared well even as the U.S. logged a massive decline in year-over-year gross domestic product in the second quarter.

The beauty of Okta's identity solutions is twofold. First, the company's portfolio of solutions isn't one-size-fits-all. Rather, the company encourages its clients to add new solutions as they grow. An uptick in spending from existing clients will push Okta into the profit column over the long run.

Secondly, the company derives 95% of its revenue from subscriptions. Subscriptions generally offer excellent margins and predictable cash flow. They also keep existing clients loyal to Okta's security solutions. 

One researcher examines vials while another takes notes on a clipboard.

Image source: Getty Images.

Vertex Pharmaceuticals

Specialty drug developer Vertex Pharmaceuticals (VRTX -0.17%) is another smart stock to buy with $1,000 if the market crashes. 

Vertex's claim to fame is its product portfolio, which targets cystic fibrosis (CF) -- a hereditary disease that leads to the production of thick mucus that can obstruct a person's lungs and pancreas. CF has no cure, but Vertex's mutation-specific assortment of CF therapies has become the standard of care.

It's looking as if the real star for Vertex is going to be its three-in-one combo therapy Trikafta, which was approved by the U.S. Food and Drug Administration a good five months ahead of schedule. In phase 3 studies, Trikafta met all of its primary and secondary endpoints. 

Despite being on the market for only two full quarters, Trikafta has become Vertex's top-selling drug, and has already achieved blockbuster status (i.e., $1 billion-plus in annual sales) in its first year on pharmacy shelves. 

Vertex's well-protected portfolio of CF therapies should catapult sales from $4 billion in 2019 to an estimated $9.2 billion by 2024. Trikafta could be pacing north of $6 billion in sales by itself at its annual peak.

A stack of gold ingots atop a one hundred dollar bill.

Image source: Getty Images.

Yamana Gold

A third company to buy if the stock market crashes is gold stock Yamana Gold (AUY). Though gold stocks are traditionally viewed as hedges to a choppy market, the gold industry appears primed for many years of success.

A substantial rise in selling prices should be a major tailwind for Yamana. Global bond yields have plunged, and the U.S. Federal Reserve is expected to keep its federal funds rate very low for at least the next couple of years. In other words, investors looking for inflation-topping income are going to have a hard time finding it. When coupled with the Fed's unlimited quantitative easing measures, the table is set for the U.S. dollar to be pressured and for physical gold to thrive.

When it comes to Yamana Gold, there are two enticing catalysts. First of all, Yamana's production is headed in the right direction. The Canadian Malartic mine, which is co-owned with Agnico Eagle Mines, is firing on all cylinders, and the Cerro Moro mine was recently brought online. With an expected 890,000 gold equivalent ounces (GEO) expected in 2020, Yamana Gold should be able to top 1 million GEO in 2021 and 2022.

Additionally, Yamana Gold has done an excellent job of paying down its debt over the past five years. As of the end of the most recent quarter, Yamana's net debt is down to $768 million, which has been more than halved since 2015.

Gold stocks may be viewed as a downside hedge, but Yamana Gold can be confidently purchased during a crash for the long run.