If you're worried about the stock market crashing, then now is a good time to review your portfolio allocation. It's never a good idea to panic and sell all of your stocks, but it's important to make sure that your investment allocation is aligned with your risk tolerance and time horizon. We could see a market downturn if high interest rates trigger a recession. These two stocks could provide a nice hedge for your portfolio in a bear market.

1. Gilead Sciences

Gilead (GILD 0.23%) is a biotechnology company with a broad portfolio of drugs focused on the treatment of HIV, viral hepatitis, and several cancers. That portfolio includes blockbusters Biktarvy, Descovy, Genvoya, Odefsey, Yescarta, Vekrlury, and Sofosbuvir. Gilead's pipeline also has dozens of candidates at various stages of development and clinical trials.

If a market crash is coming, it will likely be the result of a recession. The Fed has been hiking interest rates to combat inflation since last year. High rates tend to slow economic activity, and this can trigger a recession as businesses lay off employees and abandon expansion plans. That's been a fear shared by many investors for a while now, but recent economic data points have created optimism. The S&P 500 is up more than 16% year to date thanks to that optimism, so the market is likely to tumble if a recession comes to fruition.

Shopper in a store with a cart of groceries, browsing pharmaceuticals.

Image source: Getty Images.

Like many of its pharmaceutical peers, Gilead is fairly well protected from the effects of economic cycles. Demand is fairly steady for the treatments of serious diseases. Even if people are struggling financially, these treatments are often covered by medical insurers or government payors. Moreover, Gilead's portfolio diversification means that it can probably overcome any issues with individual products. Its robust pipeline also means that it should have continued growth opportunities over the next few years.

Gilead is unlikely to turn any heads with rapid growth, but that's not what investors care about when it comes to hedges. This biotech stock delivers relatively stable sales and profit margins, and the stock itself is not prone to volatility.

Chart showing Gilead Sciences' revenue and operating margin down since 2016.

GILD Revenue (TTM) data by YCharts

Gilead's beta is only 0.53, meaning that it tends to fluctuate significantly less than the market in general. Some of that is due to the stable business fundamentals discussed above. The stock also sports a forward price-to-earnings (P/E) ratio under 12. That valuation is cheap enough to create downside protection.
Other stocks with more aggressive valuations are likely to tumble further if the market turns sour.

Even better, Gilead pays a 3.9% forward dividend yield that will generate a decent return even when the market is down. With a payout ratio of only 0.66, the company isn't straining to return that much cash to shareholders.

2. Kroger

Kroger (KR -0.75%) operates a number of popular grocery chains, with nearly 3,000 locations across 35 U.S. states. The company's total sales were just under $150 billion last year, which translates to roughly 6% market share. The grocery store industry is highly fragmented outside of Walmart (NYSE: WMT), which dominates the space, so that 6% market share actually makes Kroger the third largest company in the industry on the basis of revenue.

Grocery stores are among the most recession-resistant stocks you can buy. People tend to change consumption patterns when money is tight, but they still buy food and other staples. This can affect the bottom lines of these chains, especially given their narrow profit margins, but they are less cyclically volatile than other sectors. Kroger's scale, along with its geographic and brand diversity, further enforce that stability.

Chart showing Kroger's operating margin down since 2010.

KR Operating Margin (TTM) data by YCharts

Kroger is a Warren Buffett stock that produces a ton of reliable cash flow, and Berkshire Hathaway (NYSE: BRK.A) is one of the largest shareholders outside of institutions that manage funds. Sustainable cash flows are one of the best ways to hedge against a market crash, especially those driven by recessions.

The company returns that cash to shareholders, and the stock currently has a healthy 2.5% dividend yield with a low payout ratio. Kroger's forward P/E ratio is only 10.6, and its beta is 0.29. These factors would all support Kroger if the market were to crash. The stock would go down, but it would likely outperform the S&P 500 and Nasdaq while delivering dividend returns.