The scene: Black Friday, about noon, my house.

I was about to go to the supermarket. My wife, knowing that my favorite grocery store shares a parking lot with a humongous TJ Maxx/HomeGoods, and knowing that parking within a quarter-mile of it on the weekend after Thanksgiving requires a miracle, suggests I go to the other nearby supermarket instead.

I say no. I can't stand that place. The produce is lousy, the meat is lousy, and the staff moves like they put Librium in the employee coffeemaker. I tell her I'll brave the traffic. I take the smaller of our two cars, in case the only parking available is a tiny space between SUVs, and head over, prepared for the worst.

Except there was no worst. There was plenty of parking. It was less busy than I'd expect on any normal Saturday. We've lived here for 10 years, and every year I end up trying to run some errand in that shopping center on the weekend after Thanksgiving. And every year, I end up hiking the proverbial quarter-mile through mobs.

But not that day. This was unprecedented. Stunning.

If I had owned stock in TJ Maxx's corporate parent TJX Companies (NYSE:TJX) at that moment, I would have been strongly tempted to log into my brokerage account via my phone and sell it right then and there, while I was standing in that parking lot.

But here's the thing: No matter what you think of the prospects for TJX's stock -- and opinions on CAPS seem to boil down to "good company, tough sector" -- that one data point wasn't going to drive its long-term stock price.

So what does?

What drives a company's stock price?
Viewed from a very high level, a stock price has three basic drivers:

  • The market. Generally speaking, stocks go up in bull markets, down in bear markets, and down a whole lot when the market "crashes." In the first nine days of October, McDonald's (NYSE:MCD) fell from above $63 to about $52. Lots and lots of other stocks fell hard during that time, but did the discounted future value of McDonald's -- a solid, stable company that is more recession-resistant than most -- really decline by 18% over those nine days? Probably not. It just got carried down with the rest of the market -- less so than many others, but still down more than its fundamentals probably deserved.
  • The sector. Psst ... want to buy a bank? I bet you don't. Many investors won't go near bank stocks right now. It doesn't matter whether you're looking at a small local bank with a gold-plated balance sheet or Bank of America (NYSE:BAC); the near-term outlook for banks (and for bank stocks) in general isn't very good right now. That's also true for retailers who focus on apparel, like TJX or Abercrombie & Fitch (NYSE:ANF). While TJX is probably a healthier company with a better near-term outlook than troubled Abercrombie, both took hard hits to their stock prices in recent weeks, along with the rest of their sector. "Retail's tough right now, except maybe for heavy discounters like Wal-Mart (NYSE:WMT)," most analysts will tell you, and lots of investors will agree -- and have taken their money to other parts of the market.
  • The company's fundamentals. This is where we as investors focus most of our attention, and rightly so -- it's the place where careful research and analysis can lead to huge outperformance, and it's the place that really drives the long-term stock price. Bulls and bears come and go, sectors go in and out of favor, but strong well-run companies make us money no matter what. It's easy to just "buy the market" or "buy a sector" via an index fund or ETF. But most of us want to do better. We want the companies with huge growth prospects that other investors haven't discovered yet, the still-tiny global giants of tomorrow, the kinds of stocks that turn modest investments into immodest sums. We want Microsoft (NASDAQ:MSFT) at a split-adjusted eight cents in 1986 or Qualcomm (NASDAQ:QCOM) at a split-adjusted $3 in 1998 -- and the immense profits that followed.

More than anything else, it's the company's fundamentals that drive the stock price over the long term. That may seem really obvious, but look at all the good companies that have been sold off by investors worried about the market! For some of those companies, economic woes really will change the fundamental outlook. For others, especially when one takes a long-term view, a bear market is just a buying opportunity -- and a crazy time to sell.

So how can you uncover the best opportunities? Let us help you out. The Fool's Hidden Gems team has created a list of the best recession-resistant buys for right now, and I think there are some tremendous opportunities -- future doubles, triples, and more -- on that list. You can see it all in seconds with a 30-day free trial. There's absolutely no obligation to subscribe.

Fool contributor John Rosevear has no position in the stocks mentioned. Bank of America is a Motley Fool Income Investor selection. Wal-Mart and Microsoft are Motley Fool Inside Value recommendations. Try any of our Foolish newsletters free for 30 days. The Motley Fool has a disclosure policy.