I am not an overly -- or overtly -- sophisticated person. Upon hearing about SanDisk's (NASDAQ:SNDK) big earnings whiff last week, my first wish as a shareholder was to sock CEO Eli Harari, Ph.D., right in the beezer. How could management refuse to say a word about a major upcoming margin gaffe, while, over the same period, the not-so-good Dr. H. dropped a million bucks' worth of stock per month, including $1.8 million the week before the earnings release cratered the stock? Not a word? C'mon, guys. That's shoddy IR, to say the least.

Since absorbing that nasty paper loss -- mitigated, somewhat, because I took my position near the low of the last big dip -- my ire has cooled somewhat, though I still harbor fantasies of making that trip to California, if only to give Dr. H. the old flaming bag trick. (Very unsophisticated. I did warn you.)

Yes, SanDisk stunk it up. But no, I'm not selling my shares, at least not yet. The journey from anger to resolve is something every investor needs to learn, because the surest way to lose money in the stock market is to sell every time you -- and the market -- get spooked. By following a simple four-step program, you can make sure that you make the right decision, even if you haven't made any money.

Step 1: Seethe
Go ahead and get mad. You deserve it. Throw (soft, light) stuff. Scream obscenities if you must -- in a closed room, away from young ears, please. Get it out of your system. Now, stew a bit.

Although imagining bizarre and macabre fates -- think the eighth circle of Dante's Inferno -- visited on managerial betrayers has its own reward, this is more than a cathartic exercise. If you got burned, you need to figure out why. By considering the precise reasons for your sense of anger, betrayal, shock, and intestinal discomfort, you'll get a head start on the healing that begins in step 2.

What's the problem? Top-line limbo? Sales weren't up to snuff? Did consumers turn their backs on the product? Or was it a problem with lousy execution? Did the company fumble the ball on cost controls? Sink itself with markdowns? Spend too much on back rubs and sushi lunches for the executive-washroom crowd? Was management less-than-forthright with information?

In the case of SanDisk, the disappointment was definitely threefold. First of all, revenues came in well below guidance and analysts' expectations: $408 million versus an expected $450 million. Next, margins dropped below expectations because of price declines that were more aggressive than predicted. Finally, there's the infamous failure of management to pipe up and let investors know about this in a timely fashion. Surely these trends were clear for weeks, if not months. That's why saving up the bad news while selling loads of stock during a 50% run-up just looks slimy, plain and simple.

Step 2: Stop, look, and listen
There are plenty of voices out there telling you to bail at the first sign of trouble. I'm going to suggest that you don't follow the knee-jerk crowd's reaction. If the stock has already taken a 20% dive, what's the sense of dropping out before you know all the facts? Sure, you may save another couple of points by getting out as early as possible. Stocks tend to drift farther down into the surf after initial cliff dives -- just check out the action in Coca-Cola (NYSE:KO), Colgate-Palmolive's (NYSE:CL) earnings ease-off, or Lexar's (NASDAQ:LEXR) triple plunge. But there are commissions and taxes to consider, and there's always the chance that the Street has overreacted and the stock will pop back up. I've learned this lesson the hard way, bailing too early on stocks such as Findwhat.com (NASDAQ:FWHT) only to watch them soar a few months later.

Whether you sell or not, for your future investing success it's important to get to the bottom of the problems so you can learn to avoid similar disappointments in the future.

After step 1, you should have some idea of the probable causes for the letdown. Now it's time to take a look at the numbers and listen to the explanations. To return to SanDisk, the screw-ups are relatively easy to find. First, the supply of NAND chips, the basic guts of flash memory devices, increased more quickly than demand for the devices themselves. That meant falling prices, which explain both the revenue loss and the 6% drop in product gross margins. So, take a much-reduced sales base, pay more for the goods, and then spread the resulting profit across 10% more shares than last year, and you have a recipe for a scary setback in earnings growth.

(FYI, you don't have to go it alone. The Fool community -- a trial is free -- has experts galore to help you slice and dice the numbers.)

Step 3: Remember the good times
Don't forget to look at the bright side. Sometimes, there is none. We've all owned a few of those in our day. But there are reasons for confidence in SanDisk's operational results, dismal as the bottom line turned out to be. In the plus column are: a 96% year-over-year increase in high-margin royalty revenue; a decent total gross margin of 36%, buoyed by that fat IP revenue; a 1% improvement in operating expenses measured as a percentage of total revenues; and a 230% increase in interest income that added $5.3 million to the bottom line.

Step 4: Review the real bottom line
The real bottom line for any investor is, "What's in it for me in the future?" If the real and true answer is "nothing but a stomachache," then maybe it is time to stop struggling, treat your wounds, and recuperate for the next bout.

But remember that your shares are more than just a claim on a company's future earnings; they're a claim on the company itself. It may be tough, but now is the time to take a hard look at your firm's business plan, its moat -- if any -- and its future prospects in its respective market.

The bottom line on SanDisk
To get to the meat of the SanDisk dilemma, the worry is that big earnings growth is over because of the rapidly dropping prices for NAND flash memory. True, this is a volatile sector, but a review of SanDisk's position shows a lot to admire.

First, let's talk about flexibility. By producing some of its own NAND flash through partnerships, as well as buying memory on the market, SanDisk can adapt to market variability without the giant swings that punish rivals. If you were appalled by the 6% drop in product gross margin at SanDisk, take a look at what happened to Lexar.

That brings us to the firm's leadership position in the field. As the inventor of flash memory, not only does SanDisk lead in sales and margins but also the intellectual property licensing guarantees that it gains from the very competition that is snapping at its heels. More importantly, SanDisk can pick and choose when to start the price wars that have the potential to bring a lot more pain to rivals. As this quarter shows, there's some self-inflicted damage to consider, but there's a lot to be said for the firm's ability to remain profitable while the competition just struggles to stay alive.

SanDisk's forward-looking strategic planning is another strength. While competitor Lexar's recent moves included some nifty gadgets for a limited market and a sales agreement with stodgy old Eastman-Kodak, SanDisk's plans look toward the future. Standard-development agreements with nimble flashling M Systems (NASDAQ:FLSH) have the potential to open new marketing and licensing opportunities.

On purely operational terms, the switch to 90nm production should provide material cost reductions. And by the end of 2005, SanDisk should start seeing production from its 300mm fabrication partnerships, which can provide even more significant savings because of the shift to larger wafers.

The final catalyst is the market opportunity for flash itself. It's no exaggeration to say that the world is moving to flash. Four-gig flash cards are now available and will drop rapidly in price and become more common. They will take the place of hard drives in larger-capacity music players such as Apple's (NASDAQ:AAPL) iPod Mini and many other gadgets. Digital camera sales are expected to be huge this holiday quarter. As the resolution grows, so does the need for flash megabytes. Digital video cameras, GPS systems, PDAs, camera and videophones, even store-bought record albums are all depending more and more on flash chips. Single-use flash chips are selling slowly for now, but they have the potential to turn SanDisk into this century's Kodak.

Risks? There are plenty. And this is sure to be a bumpy ride, but after reviewing all the evidence and considering the current price, I'm sticking with SanDisk. In general, I won't sell at a price that looks like a good buy. If I ask myself, would I buy the leader in an explosive industry, with a technological advantage and pricing power over its rivals, for a PE of 13 and an EV/FCF ratio near 11, the answer is "yes."

For related Foolishness:

Seth Jayson still prefers film but realizes that he's a moldy old relic. At the time of publication, he had positions in SanDisk but no other company mentioned. View his stock holdings and Fool profile here. Fool rules are here.