I've never been one for market timing, but I'm also not fond of ignoring what's going on in the market and stepping in front of an oncoming bus. Having a good grasp on what's going on at the macro level of the stock market and the economy as a whole can be a good guide to when you should think about buying certain stocks. Right now, we're in a very peculiar market, one that has presented a lot of great opportunities but has also steamrolled people who are in certain classes of stocks.

As Bernadini goes, so go I
In horse racing, you have to consider a number of factors when choosing which ticket you're going to buy. These include the horse's previous performance, the horses that it's racing against, the odds, and the track that they're running on -- among other things. You may, for example, end up choosing a completely different horse on a muddy track than you would on a hard, dry track. Sure, Cash My Check has had a good streak of wins, but if it's a nasty day and Rusty Turtle is a master at running a slow, muddy track, then you'd better believe the smart money is on Rusty Turtle.

And the same goes for stocks. When we have a fast bull market, as we did toward the beginning of the year, it's pretty tough to find something that doesn't work. Where people did especially well were the really exciting, high multiple growth stocks. Companies like SiRFTechnology, Marvell Technology, and Broadcom Corp. saw some really impressive gains at the end of 2005 and in January and February of this year. Meanwhile, good ol' trusty performers like Coca-Cola (NYSE:KO) and Johnson & Johnson (NYSE:JNJ) saw more muted gains, if their shares did anything at all.

Now that we've been through the weed-whacking of May, June, and July and oil prices, the economy, and the Federal Reserve have sufficiently rained on our parade, our racetrack isn't quite as quick as it was earlier in the year. SiRF is down a swift 52% since mid-April, and Broadcom is down 48% since early March, and they're just the tip of the iceberg. The Nasdaq, known for the fast company that it keeps, is down more than 8% on the year after being up more than 4% in January alone. So now, stuck in the mud and bogged down by the current sentiment on Wall Street, which way should we turn?

If you want to talk about what has been working on Wall Street, you obviously have to look no further than the oil and gas clique. There have been some pretty significant run-ups in the whole group, from the big guys like ExxonMobil (NYSE:XOM) and Chevron (NYSE:CVX) to smaller players like Alon and Giant Industries to overseas players such as CNOOC and PetroChina. Each day, it seems, there's some new development or emerging trend that favors some of these stocks.

We've got conflict in the Middle East, unpredictable leaders in South America, a corroded pipe in Alaska, and the world's largest nation going through its industrial revolution and sucking up oil like there's no tomorrow. In case you're wondering, by the way, that nation is China, and you'd better believe that the people there are using a lot of oil, whether they admit to it or not.

So besides the oil stocks, which should be going up right now no matter what the rest of the market is doing, where are the stocks that have managed keep their hooves from getting stuck in the mud? Primarily, it's the stocks that don't scare anybody -- the stocks that carry very little risk of going belly-up if the economy takes a turn from lukewarm to downright ugly. Those stocks are the ones selling things that people are going to need no matter what's going on: food, toilet paper, toothpaste, deodorant (I hope), shampoo, coffee (we're talking Maxwell House here, not Starbucks!), and, alas, cigarettes.

If you're a parent -- and for those non-parents out there, just imagine for a minute -- think about the type of guy you want your daughter dating. Most people are likely thinking of someone with characteristics like "non-threatening," "responsible," "honest," "non-motorcycle-riding," "hard-working," "dependable." That's the kind of stock that's doing well right now.

By way of illustration, check out Unilever (NYSE:UL). It does the classics: Dove soap, Hellman's mayo, Surf laundry detergent, and Lipton tea. In the late 2000 to 2002 timeframe, when guys like Broadcom were doing a death spiral from triple-digit stock prices to the high single digits, Unilever saw gains in the 40%-50% range. Some other keen names here are companies like Cadbury Schweppes (NYSE:CSG), CVS, and, oh, yes, Altria Group (NYSE:MO) -- besides cigarettes, Altria's Kraft division does all the Kraft foods, as well as other brands like Maxwell House.

Run to your broker, Fool!
Of course, I'm not recommending that anyone drop all of his shares in AMD or Salesforce.com and fill up her portfolio with conglomerates and ball-bearing manufacturers. I think it's important to maintain a diversified portfolio, and this means having a deep bench of players ready for the best of times as well as the worst of times. Besides, though you may hear some people refer to this group as the "defensive" stocks, there was nothing defensive about owning this group in the height of the dot-bomb era; our friend Unilever dropped from $44 in mid-1998 to just more than $24 in mid-2000.

I'm not planning on joining the chorus of people trying to read the tea leaves to say what's going to happen with the economy over the next few years, but what I do know is that if it continues to storm on our racetrack, we may not see a swift-footed Secretariat in the near future.

More muddy Foolishness:

Johnson & Johnson and Unilever are Income Investor selections. Coca-Cola is a Motley Fool Inside Value recommendation. All of our investing newsletters come with a free, 30-day trial.

Fool contributor Matt Koppenheffer avoids the muddy racetrack issue by keeping his money out of the tracks and in the stock market. Matt owns shares of Marvell Technology. The Fool has a crystal-clear disclosure policy.