With the stock market recently hitting fresh record highs, many investors are worried about a correction or even a full-blown stock market crash. Fortunately, not all stocks react to difficult economic times in the same way -- in fact, some even do well when the market drops. If you think the bull market's run may be on its last legs, here are three stocks that can help you play defense in your portfolio.

This retailer's stock price actually went up during the Great Recession

It's true that many retailers are struggling right now, but Wal-Mart (NYSE:WMT) certainly isn't one of them. It continues to grow sales, and seems to be one of the only major retailers willing and able to compete with Amazon.com for e-commerce market share.

A businessman looking at a stock chart and holding his head in frustration.

If the stock market crashes, these are the types of stocks you want your money to be in. Image source: Getty Images.

Wal-Mart is a great stock to own during a market crash, regardless of its e-commerce success, because its business model actually helps the company when times get tough. Simply put, when people are forced to cut back, they shop at Wal-Mart instead of at higher-end retailers, and Wal-Mart's usual customer base continues to shop at the store.

This could be clearly seen during the Great Recession. While other retailers saw sales plunge, Wal-Mart's sales actually grew by 6.5% in 2008. Investors recognized the safety of Wal-Mart's business model, and the stock went up by 10.5% during that same year, while the S&P 500 dropped by nearly 35%.

As my colleague Adam Levy recently pointed out, Wal-Mart's vast physical presence may actually give it an advantage over Amazon when it comes to in-store pickup and things like online grocery ordering. While it remains to be seen how Wal-Mart's battle with Amazon plays out, this is a recession-resistant business that should do fine no matter what the economy does.

Defensive real estate with massive growth potential

When it comes to commercial real estate, there are two main factors that make a property type defensive or recession-resistant. First, do tenants lease the properties on a short- or long-term basis? And second, does the property provide goods or services people need or that they want?

For these reasons, healthcare real estate is about the most defensive type of real estate there is. Sector-leading healthcare real estate investment trust Welltower (NYSE:WELL) owns nearly 1,400 healthcare properties, most of which (70%) are senior housing.

Not only is healthcare real estate defensive in nature, but there's an incredible growth opportunity in the industry. With the retirement of the aging baby boomer generation, the older segments of the population are expected to grow rapidly in the decades ahead. The 85-and-older population is expected to double over the next 20 years, and this is the demographic most likely to use senior housing, Welltower's primary focus.

In tough times, people need a bargain

Many investors are hesitant to invest in any type of brick-and-mortar retail right now, so my suggestion of Tanger Factory Outlet Centers (NYSE:SKT) may come as a surprise, especially since we're talking about stocks to own when the economy goes bad. After all, if retailers are struggling while the economy is doing well...

This is certainly a legitimate concern, but not all retail is in the same boat. As we saw in Wal-Mart's case, companies that specialize in discount-oriented retail tend to do well in any economy. Tanger Outlets CEO Steven Tanger has said, "In good times, people love a bargain, and in tough times, people need a bargain."

Outlets also tend to be e-commerce-resistant, as they tend to offer unique bargains, and much of the appeal of outlet shopping is doing it in person -- that is, the act of bargain-hunting itself.

The numbers prove these points. Tanger's enterprise value has grown consistently, including 40% growth from 2007-2010. The company has raised its dividend every year since its 1993 IPO, and its occupancy never fell below 95% in its 24-year history.

What to expect if the market crashes

To be perfectly clear, I'm not saying that these three stocks won't go down if the stock market crashes. Rather, I'm saying that they should weather the storm better than most other companies. Earning excellent long-term returns isn't only about making money when the economy is doing well. It's also about outperforming the market during the tough times -- and these three stocks are capable of doing just that.

Matthew Frankel has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Amazon. The Motley Fool recommends Tanger Factory Outlet Centers and Welltower. The Motley Fool has a disclosure policy.