The market's reaction to news of the outbreak of coronavirus in China has reminded investors that stocks don't always move straight up. After years of strong performance for stocks, many investors are looking at ways to protect their gains and preparing for a possible extended downturn.

Experienced stock investors know that panic-selling at times of stress is the worst thing to do. A better approach is to look for ways to reduce the risk in your stock portfolio. You can't take past results and count on them repeating in the future, but there are several stocks that have ridden out past bear markets far better than broad market benchmarks. Here, we'll look at three of those strong past performers and see why they might do equally well in a future downturn.

McDonald's

Fast-food giant McDonald's (NYSE:MCD) has built up a reputation over the years for providing good value to restaurant-goers across the world. That's often a big selling point during economic downturns that can lead to bear markets, as cash-strapped customers look to economize on discretionary expenses like eating out without giving up restaurant eating entirely. In 2008, that helped McDonald's stock post modest gains for the year -- even as the S&P 500 dropped 37% and most other stock market indexes suffered similar losses.

McDonald's restaurant location with logo near dusk.

Image source: McDonald's.

McDonald's has come a long way in the past 10 years, bulking up its McCafe beverage offerings to lure in a brand new customer demographic. It's also embraced trends toward artificial intelligence and automation, enabling customers to get delivery or place advance orders through their smartphones and other mobile devices. Much about McDonald's remains the same, though, including an attractive 2.4% dividend yield that reflects 44 straight years of annual dividend increases. With the fast-food company's inherent defensive qualities, McDonald's stock still looks like it could benefit under economic conditions that would send other companies into turmoil.

General Mills

Sticking with the food stock  theme, General Mills (NYSE:GIS) plays a greater role for those who prefer to dine in. Its cereal products are mainstays of many families' breakfast routines, and a host of other packaged foods round out a full menu of offerings for hungry customers. During 2008's bear market year, General Mills stock managed to rise 7%, as investors appreciated the boost to its business from those looking to rein in their food costs in their budgets.

General Mills has primarily attracted the attention of dividend investors, who like the stock's 3.7% dividend yield. The company has paused on boosting the payouts that shareholders receive in order to help bolster growth prospects, but General Mills believes that cost-cutting efforts should improve profitability in the near future. Despite intense competition in the food industry, General Mills has used a combination of strategic acquisitions, global expansion, and product shifts to align its business more with consumer tastes. That bodes well for the company and could help it sustain solid performance even in a market downturn.

Walmart

Finally, Walmart (NYSE:WMT) needs no introduction as the blue-chip giant in department store retail. The company's stock price jumped 18% in the 2008 bear market, as investors appreciated the company's ability to pivot toward serving new customers who were desperately seeking to make ends meet by buying lower-priced products.

Walmart's business has changed considerably in that time, as the ongoing rise of e-commerce forced the company to beef up its own online and mobile channels. Having gone through a painful period of massive internal investment to do so, Walmart is now reaping the rewards, as customers come to appreciate the benefits of faster delivery and more options for finding the products they want and need. A dividend yield of 1.8% is somewhat below the market's average, but Walmart's 46-year history of dividend increases suggests that the retail giant won't be content to leave its shareholders feeling below average for long.

Don't panic!

Selling stocks outright during a market downturn can be tempting, but it's also often deadly to your financial aspirations. Finding stocks that you can count on during difficult times is a better choice, and these three stocks have shown that they have what it takes to survive past bear markets.