At nearly eight and a half years, investors have enjoyed one of the longest bull markets in U.S. history. Only the bullish run from 1987 to 2000 has exceeded the current period. Though we're still four years away from breaking that record, all good things do come to an end -- eventually, the market will turn sour.

With the great recession and dot-com burst fresh on investors' minds, it's natural that some are feeling nervous about an inevitable bear market. It would be folly to try and predict when the tables will turn, but whenever I'm feeling a little anxious, I remind myself of a famous quote from legendary investor Peter Lynch: "Far more money has been lost by investors preparing for corrections, or trying to anticipate corrections than has been lost in corrections themselves."

So for investors who want to find stocks that might not be so vulnerable to such a correction, one strategy is to find companies that have historically outperformed when economic times are tough.

Off-the-rack bear market performance

Two that come to mind are off-price retailers The TJX Companies (NYSE:TJX) and Ross Stores (NASDAQ:ROST). Both companies kept shareholders happy during the last two bear markets:

  March 2000 to Oct. 2002 Bear Market
  Stock return S&P 500 return Outperformance
TJX 58.4% (49.1%) +108.6%
ROST 76.3% (49.1%) +125.4%

Chart by author. Includes period from 03/24/00 to 10/09/02 when the dot-com bubble and Sept. 11 attacks sent many stocks plunging.

  Oct. 2007 to March 2009 Bear Market
  Stock return S&P 500 return Outperformance
TJX (26.8%) (56.8%) +29.9%
ROST 8.1% (56.8%) +64.9%

Chart by author. Includes period from 10/09/07 to 03/09/09 following the collapse of the housing bubble and onset of the financial crisis.

More recently, TJX Companies failed to generate positive returns but still handily beat the S&P 500, cushioning the blow for shareholders during the tremendous downturn that came with the financial crisis.

Not included in the tables above is Burlington Stores (NYSE:BURL), another off-price retailer that didn't trade publicly until 2013. Burlington Stores, operator of Burlington Coat Factory, has not experienced a bear market yet, but it's just as appealing as its off-price peers for similar reasons. During tough times, consumers are more willing than ever shop with discount retailers. This is exactly what happened at TJX and Ross from 2007 to 2009, as the two companies grew revenue 11% and 16%, respectively. 

A woman wearing a Ross Stores outfit in a garden.

Image source: Ross Stores.

A choice investment for bears and bulls

The Motley Fool takes a long-term perspective when it comes to picking stocks. We don't try to pretend we know what the market is going to do in the next month or year, so it may seem contradictory to make investment decisions based on a potential market downturn. After all, with a long enough investment horizon, the stock market has historically gone up more than it has gone down, so why even bother taking defensive positions?

Well, the beauty of off-price retailers is that they have proven themselves worthy during good times and bad. 

Sure, it makes sense that off-price retailers perform well when the economy is slowing, but the sector is no slouch otherwise. For example, TJX has been a consistent performer for all types of markets and economic conditions. The company has enjoyed 21 straight years of same store sales growth and has had only one year-over-year comparable store sales decline in its 40-year history. Not many retailers in the apparel industry can match that type of track record. And over the last three years, a time when the economy has slowly approached full-employment, TJX, Ross Stores, and Burlington have all managed to meet or exceed the S&P 500.

TJX Chart

Data by YCharts.

Don't ignore the 800-pound gorilla

Despite the industry's strong, long-term performance, the last year hasn't been kind to off-price retailers. Only Burlington has logged positive returns along with the S&P 500.

TJX Chart

Data by YCharts.

As it turns out, the retail industry has changed quite a bit, and even TJX, Ross Stores, and Burlington have felt the effects of declining brick-and-mortar retail traffic. Much of that can be blamed on the likes of Amazon and e-commerce.

But these companies still have aces up their sleeve -- not only is it difficult to replicate the in-store treasure hunt experience online, but the "off-the-rack" model is not conducive to online shopping. For example, TJX has a last-minute inventory purchasing strategy that helps it score better pricing. Those purchases come from over 18,000 vendors and may include just a few items of any single stocking keeping unit. Attempting to sell a large variety of products with limited supplies would be a logistical nightmare for online competitors. The fact that the three off-price retailers have been able to succeed despite having little to no e-commerce presence goes to show that Amazon cannot swoop in so easily and disrupt the business model. 

Successful investing isn't about timing the markets but how much time you spend in them. More often than not, long-term investors are going to outperform those that buy and sell regularly at the so-called "perfect time". With the market near all-time highs, many investors may be feeling the urge to sell high for a chance to buy low down the road, but it may be a better idea to look at the companies that have shown they can reward shareholders in any environment.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.