Stock markets are sitting near all-time highs -- the S&P 500 Index trades for 18 times 2015 operating earnings -- and many analysts believe a correction is in store. This is especially problematic considering the tough headwinds many companies are facing, including the strong U.S. dollar and potential for rising interest rates.

A simple solution is to just sell all of your stock holdings. But for some investors, that is not a viable option, especially those of us counting on our portfolios to generate income through distributions and dividends. With interest rates still near zero, there are few alternatives to make up for those payments.

Wal-Mart Stores (WMT -0.10%), McDonald's Corporation (MCD -0.86%), and PepsiCo (PEP -0.59%) may not be the sexiest names, but these stocks should outperform during a bear market and continue to provide the yield that income investors desire.

Low volatility
First off, these companies are defensive in nature -- large-cap consumer goods companies with offerings that millions of households turn to everyday, regardless of what the overall economy is doing. This results in a steady stream of cash and profits.

This defensiveness is often quantified using beta, a statistical measure that compares how much a stock is expected to rise or fall for every 1% move in the broader market. For example, if a stock carries a beta value of one, it should rise or fall in step with the S&P 500. This metric is a valuable tool to identify which stocks are typically stable or more volatile.

As for the companies in question, Wal-Mart, McDonald's, and PepsiCo all have beta values below one. McDonald's is the lowest at 0.67, followed by Wal-Mart and PepsiCo at 0.76 and 0.82, respectively. That said, if the market falls off, these stocks will not be completely immune to downward price pressure -- that is the nature of market risk. But for anyone who owns stocks for the income, at the very least, these three companies should hold up better than most.

This low beta does not get much merit when stocks are rallying. The bull market over the past several years has resulted in reduced appreciation for defensive stocks. But it was not too long ago that they proved their worth. In fact, McDonald's and Wal-Mart were the only two stocks in the Dow Jones Industrial Average to trade up in 2008, a year when the Dow shed over 30%.

Dividend growth
These companies can also employ another shield against a market downturn -- their rich dividends. Falling between 2.5% and 3.5%, their yields outpace the S&P 500 and its 2% average. Even the 10-Year U.S. Treasury Bond only yields 2.4%, and investors can enjoy the likely dividend growth

The other huge advantage for investing in these stocks over bonds is their elite status as dividend aristocrats, which means the dividend payout will only grow in years to come.

Wal-Mart, for example, has increased its dividend for 42 years in a row, while McDonald's and PepsiCo enjoy growth streaks of 38 years and 43 years, respectively.

The bottom line
They might not be the hottest growth stocks, and they may not beat the broad market during bullish periods. However, after several years of tremendous gains, many analysts and investors are calling for a correction. If that is the case, defensive stocks are the place to be for those investors who need to remain invested for income.

These three companies have large, steady business models with very low volatility. They pump out reliable dividends year after year, even growing them annually for decades. From that perspective, it is Wal-Mart, McDonald's, and PepsiCo that should be in your portfolio if the markets take a turn for the worse.