Where were you on Oct. 14, 2002? I was witness to the birth of a 30-bagger. Sure, it's easy to look back at a big winner and pine, "If I'd bought Dell (NASDAQ:Dell) in 1992, I'd be rich." But this story is different. In this story, I was there. I knew the business, and I knew the stock was way undervalued.

Unfortunately, I hadn't yet learned the lessons of Benjamin Graham, John Neff, Shelby Davis, and Philip Durell. Unfortunately, I didn't know value investing.

Let me take you back
At the beginning of 2002, I was working at a California refinery that was owned by Ultramar Diamond Shamrock (UDS), which had just purchased the plant from Tosco, now a part of ConocoPhillips (NYSE:COP). Sadly, there was a fatal accident at the plant before the transfer of ownership, so the local regulators included a massive upgrade effort as part of the purchase requirements. Therefore, after buying, UDS put nearly $400 million of upgrades into the refinery. Shortly after the upgrades were made, UDS was purchased by Valero (NYSE:VLO). (I know it's difficult to keep track of all the players, but we'll be getting to the 30-bagger in a moment.) Because Valero already owned two other refineries in California, regulators required that it sell the refinery.

At that point, Tesoro (NYSE:TSO) entered the picture.

When Tesoro purchased the refinery, I didn't think about buying the company's stock. It was selling for about $14 per share, and the company was taking on a ton of debt to purchase the largest refinery in its system. Then the stock price started falling, and we (the employees) began watching it like a sport. It dropped to $8, then $6, then $4. Everyone started wondering how low it would go. Pundits even suspected that Tesoro would go bankrupt. Some of the guys at the plant bought at $7, only to bail at $4, afraid of losing everything. By Oct. 14, 2002, Tesoro had fallen to $1.70 a share.

I wasn't afraid of losing everything, because I wasn't going to buy. Refining stocks didn't seem very exciting after the great run I had during the boom with Weinerschnitzel.com. Instead of worrying about the next big thing, I should have been running the numbers on Tesoro.

At $1.70 a share with 60 million shares outstanding, Tesoro had a market cap of $102 million. The company was losing money, it had $2 billion in debt, and there was a risk of bankruptcy. Cash on hand was approximately $100 million. Mr. Market, in one of his fits, was saying that Tesoro was worth only its $2 billion in debt.

The value secret
This is where value investing would have made the decision very clear. Value investing is simply buying shares for a price that is far below their intrinsic value. If you could buy an iPod for $15, a house on the Pacific coast for $50,000, or a new BMW for $1,500, you would.

In Tesoro's case, Mr. Market was offering a network of five refineries, along with assorted terminals and retail stations, for an assumption of $2 billion in debt. That's a deal as good as the examples I've provided. Let's take a look:

First of all, it was fair to assume that Tesoro would be very profitable, that profitability would erase fears of bankruptcy, and that the market would apply a reasonable multiple to the profits. In the three previous years, the four original refineries had earned an average of $1.76 per share. The refinery that Tesoro had just bought was profitable, California refinery margins were higher than the U.S. average, and the refinery had just completed the aforementioned $400 million of upgrades. All it had to do was return to normal operation, and Tesoro would be earning more than $2 a share. Assuming a price-to-earnings ratio (P/E) of 7, the shares would easily rise to $14 -- for an eight-bagger!

Another way of looking at Tesoro's situation would have been to examine its assets. There were five refineries in the Tesoro system that could have been sold for at least $3 billion -- completely ignoring the terminals and service stations. There hasn't been a new refinery built in the United States in 30 years; therefore, existing plants are highly valued. Selling the plants would have covered the $2 billion in debt, with $1 billion left over. This elementary school math would have shown that Tesoro was a 10-bagger in the making.

The last word
Yet Tesoro hasn't been an eight-bagger, and it hasn't been a 10-bagger. From $1.70 to today's price north of $50, Tesoro has been a 30-bagger in less than three years. That's the kind of incredible reward investors can reap from value investing. While Tesoro's financial condition at the time made it a much spicier meatball (read: risky) than the usual Motley Fool Inside Value pick, it does prove that 30-baggers aren't limited to high-flying growth gambles. At Inside Value, lead analyst Philip Durell uses a similar strategy to identify market opportunities for subscribers. In just one year of operation, he's already beating the market by 6 percentage points. To see the more than 20 active recommendations, join Philip and his team for a 30-day free trial. There is no obligation to subscribe.

As for Tesoro ... well, there's nothing to suggest that the company has finished growing. (Quick -- run the numbers to see if it is still undervalued!)

So, what was I doing on Oct. 14, 2002? Not buying Tesoro, like I should have been.

Robert Aronen does not own shares in any company mentioned, but wishes he had followed Peter Lynch's advice to "buy what you know." Dell is a Motley Fool Stock Advisor recommendation. The Fool has adisclosure policy.