If you'll pardon the metaphor, flash memory maker SanDisk (NASDAQ:SNDK) has been bloodied and battered over the past few months. Despite quarter after quarter of strong revenue and earnings growth, this former highflier languished as the collective wisdom on the street turned sour. Everyone seemed to be muttering that the near future would bring commoditization and lower margins.

The latest ill was a pretty hefty price war that has decimated margins at competitor Lexar Media (NASDAQ:LEXR), leaving it even worse off than SanDisk, not to mention drawing a few dozen class action lawsuits. But the Street wasn't giving SanDisk enough credit. Consider, for instance, that the firm picked that fight itself, and despite a big drop in prices, yesterday's second-quarter numbers show that it not only survived, but thrived.

SanDisk's revenues rocketed up 85% to $433 million, and earnings grew 46% to $0.38 per share. But the best news for shareholders had to be the 3% gain in gross product margins. It proved that management's aggressive pricing strategy wasn't a self-defeating effort to win the battle but lose the war.

And get this, that doesn't include the inputs from licensing the company's lucrative intellectual properties to a bevy of other technology firms, including Sony (NYSE:SNE), TDK (NYSE:TDK), and Lexar. Those sales delivered 9.7% of revenues, nearly $42 million. Mix in that wad of cash, and you're looking at a gross margin of 41%.

In post-market trading yesterday, SanDisk popped 20%, and Lexar jumped 10%, ostensibly on SanDisk's good news. That makes very little sense. To judge by SanDisk's success and its gains in market share, Lexar will suffer. Despite the recently announcedEastman Kodak (NYSE:EK) agreement, it looks like SanDisk may have scored a significant win against its biggest competitor. And with innovations on the horizon like single-use camera cards and flash chips for hot-selling phones and PDAs, SanDisk seems likely to cement its leadership position in a booming field.

For more Fool tech coverage of digital life:

Fool contributor Seth Jayson loves to invest with the leader, and that's why he owns shares of SanDisk but has no position in any other company mentioned. View his Fool profile here.