Great products or services, or abundant demand from happy customers, can’t save even the best companies from the ravages of a costly legal battle. These cases may keep a low profile, but their stakes can be incredibly high.

Big outlays
More than 35 states are now investigating whether Google (Nasdaq: GOOG) violated any privacy laws in collecting its Street View data. Even when such questions or allegations prove unfounded, they can still be expensive. A legal department busily hustling to meet deadlines and provide filings in an ongoing lawsuit can't focus on more profitable concerns.

I'm not too worried about Google, given the more than $9 billion in cash and cash equivalents recently filling its coffers. Still, legal costs can be significant even for giants. The search giant recently wrapped up a years-long dispute with Viacom (NYSE: VIA-B) that cost it $100 million.

In another case, Charles Schwab (Nasdaq: SCHW) recently agreed to pay twice that amount to settle a class action suit over an unprofitable mutual fund. That was enough to wipe out almost all of its first-quarter earnings this year.

Big trouble
Smaller, less cash-rich companies face even greater dangers. Psystar, for instance, got sued by Apple (Nasdaq: AAPL) for installing Apple's operating system on Intel-chip-based Mac clones. The legal battle was enough to put Psystar into bankruptcy protection. With more than $10 billion on hand, Apple seems able to defend itself well, but even large sums can end up proving insufficient. Well-padded BP (NYSE: BP) nonetheless will likely face a host of massive lawsuits we can't even imagine yet.

These legal skirmishes can end in painful irony. Years ago, sound-card-maker Aureal fought a patent infringement lawsuit from Creative Labs in court and ultimately prevailed. But the battle was so costly that the company went out of business, only to have its assets bought by ... Creative. Ouch.

Similarly, Intuitive Surgical's (Nasdaq: ISRG) pending IPO was threatened in 2000 by a lawsuit from Computer Motion. Intuitive ended up buying the company for $148 million, just to make the problem go away.

Lawsuits can cost even victorious companies a lot of money, not to mention time and effort. Be careful when investing in a company with significant or potential legal issues. Will the lawsuit filed against Sirius XM Radio (Nasdaq: SIRI) by a disgruntled customer drain the company's critical resources? If you're following the company, that's a question well worth following closely.

Legal considerations aside, you needn't look far for stocks that can make you rich.