Gasoline is on everybody's mind these days. Prices at the pump are at record highs, and integrated oil companies like ExxonMobil (NYSE:XOM) and Marathon Oil (NYSE:MRO) are reporting tremendous earnings gains, thanks to the surging price of crude oil and the ground-to-pump control of their products. With gasoline prices shooting higher on an almost daily basis, prices at the pump are becoming an increasingly central part of life.

It's an unfortunate truth that gas prices affect everything. They're a huge part of the cost of getting to work, taking a vacation from that work, and manufacturing and transporting the merchandise available in stores. Try as you might, you simply cannot get away from the skyrocketing cost of gas. But as painful as the lesson may be, the price of gas can teach us a lot about the stock market and investing. Why? Well, if we heed its lessons, our newfound investment wealth can even make those shocking gas bills a bit easier to stomach.

The key lesson: price matters
There's a stretch of road in town that is practically crawling with gas stations. The BP's first, followed closely by a Speedway. At the corner, there are three more stations: a Mobil; a station run by the local Meijer grocery store; and a handful of pumps at Wal-Mart's Sam's Club. Not to be left out of the fray, Royal Dutch Shell has a station half a block up the road. These six stations usually offer fuel within $0.02 or $0.03 of each other, and for the most part, they all do fairly steady business.

But when it comes time to change their prices, they all follow slightly different rules. The Sam's Club sets its price once, at the beginning of the day. The Mobil station adjusts its placard in the late afternoon. The other stations typically adjust their prices late in the morning. The end result is that there is a window of time where these normally competitive stations can have vastly different prices for essentially the same product.

In that short window when the prices are radically different, customers respond to the cues. Just recently, for instance, Sam's Club set its price for the day at $2.46. Later that day, the price of crude oil continued its ascent. On that news, all the other stations in the area started charging $2.69 per gallon. With a $0.23-per-gallon advantage, the Sam's Club station had cars lined up throughout the store's parking lot. The other stations? Veritable ghost towns. People were willing to wait half an hour -- or longer -- to fill their tanks in order to save money on the transaction.

Money talks
Clearly, gas customers know the value of a dollar, and they want the best possible deal. As an investor, you should think the exact same way. The stocks you buy should be ones where you're getting a good deal for your money. Learn to look for value in your investments and you can do the same thing in the stock market. When entire companies go on sale, you can take advantage of the discounted prices and fill up your portfolio.

This is precisely how my friend and colleague Philip Durell treats investing in his market-beating Motley Fool Inside Value newsletter. He figures out what a company is worth, and he simply waits for it to go on sale. Take, for instance, Inside Value recommendation Intuit (NASDAQ:INTU), which makes the TurboTax, Quicken, and QuickBooks software. Intuit faces stiff competition from the likes of H&R Block's (NYSE:HRB) TaxCut in tax preparation, Microsoft's (NASDAQ:MSFT) Money in personal finance, and Paychex (NASDAQ:PAYX) in small business financial services. With such large companies fighting for position, the market is occasionally prone to throwing a sale on one or the other, if it believes that the competitive headwinds will grow stronger.

Earlier this year, Wall Street put Intuit on that kind of sale, offering it up at less than 15 times its trailing cash flow. Philip took advantage of that sale by recommending it to Inside Value subscribers. Since then, subscribers have seen a better than 22% return over a period when the market returned a miserly 1.5%. Just like the drivers who had a bit extra change by filling up at Sam's Club, the value investor will end up with more money by only purchasing companies on sale. Follow Philip's value strategy and you, too, can find extra money in your account. What could you do with that extra money? Here are a few ideas:

  • Invest even more, to compound your returns even quicker.
  • Take your family out to dinner for the first time in a long time.
  • Fill up your car with a full tank of gas -- even at $2.69 per gallon.

Tools of the trade
Of course, nobody knows for certain when companies will go on sale and become attractive buys. That's why every value investor has two important tools: a watch list and a discounted cash flow (DCF) calculator. The watch list is where you can keep an eye on companies that you'd love to buy -- if the price is right. Wait patiently for one of those companies to drop into your value range, then pounce on it.

That brings up an important question: What makes a company "value priced"? That's where the DCF calculator comes in handy. With that calculator, you simply plug in a few numbers based on what you expect the company to do over the next few years, and it spits out an answer that represents what the firm is worth based on those projections. If it's trading for substantially less than it's worth, it just might be time to buy. A great company may be worth watching until you can buy it at the right price, and with the combination of a strong watch list and a trusty DCF calculator, you too can beat the market as a value investor.

As an Inside Value subscriber, you'll have access to both Philip's watch list (most recently updated here for members) and an online DCF calculator (available here for members). Thanks to a judicious use of those two tools, newsletter selections like Pfizer (NYSE:PFE) have graduated from the watch list to become formal recommendations. It's also why the newsletter as a whole has beaten the market by more than 6 percentage points since it was launched a little more than a year ago.

The Foolish bottom line
If you invest in the same way you fill up your gas tank, you can beat the market as a value investor. Simply keep your eyes out for a company that is being offered for dramatically less than it should be, and then fill up your portfolio when the shares are on sale. When all is said and done, you'll have more money in your pocket by waiting for that sale.

Are you interested in learning how to shop for the best value in stocks? You can try out Inside Value with a free 30-day trial. Click here to getstarted.

At the time of publication, Fool contributor and Inside Value team member Chuck Saletta owned shares of Microsoft. He also owns a car that routinely needs gas. The Fool has a disclosure policy.