So you're facing a patent lawsuit. Or maybe you want to sue someone. Get out your checkbook, because this isn't going to be cheap.

A survey conducted last year by the American Intellectual Property Law Association to find median litigation costs for patent infringement suits produced jaw-dropping (at least for a startup) numbers: For a claim that could be worth less than a $1 million, median legal costs are $650,000. When $1 million to $25 million is considered "at risk," total litigation costs can hit $2.5 million. For a claim over $25 million, median legal costs are $5 million.

That's the cost of fighting a patent infringement suit if you're a plaintiff or a defendant. It doesn't include how much you'll have to pay if you're the defendant who loses the suit.

"These litigation costs are definitely expensive," said James Crowne, director of legal affairs at AIPLA. "But then so is the cost of getting a patent in the first place."

Welcome to the patent legal industry, a high-priced, high-stakes but ultimately indispensable part of doing business in high tech or any other industry that relies on innovation. Even the staunchest defenders of the current patent system agree the litigation can be onerous and sometimes the patents that get rewarded don't make a whole lot of sense, but they argue that the anarchic alternative would be even worse. Whether you believe them probably depends on what side of the courtroom you're sitting.

Of course, we're all paying attention to patents right now because of the high-profile, big-money fights among tech's giants and amid Silicon Valley's calls for dramatic patent reform. But for all the tooth-gnashing, very little is likely to change anytime soon. Some reform in the form of a patent appeals board is due this fall, though the exact details of how that board will work have yet to be ironed out, Crowne said. Optimists hope it will at the least cut costs.

That leaves us with what looks like a free-for-all (even if some legal experts doubt the actual volume of patent litigation has increased all that much in recent years.) Yahoo has sued Facebook so Facebook sued Yahoo right back. Apple sued just about everyone to protect the iPhone and iPad franchises. Everyone sued Apple right back. Google announced it's going to spend $12.5 billion to acquire Motorola Mobility mainly because it needs a big patent portfolio of its own to protect itself. IBM, Hewlett-Packard, and Oracle are sitting on giant stacks of patents and there's no doubt they'll use them to crush the competition if they deem it necessary.

Ultimately, all these lawsuits amount to a belly-bucking contest among the tech industry's haves. The suits are strategic, as with Apple, to protect a business. They're also board-driven, as with Yahoo, as companies come under increasing pressure to squeeze every dime out of what they own, including patents. Will Yahoo's claim be an inconvenience or a crippling handicap to Facebook as it moves toward an initial public offering? Most likely, an inconvenience.

Cheaper by the settlement

For small companies, however, simply fighting a patent suit can be financially ruinous. That's why many are willing to settle, even if they believe they did nothing wrong. It can be cheaper to settle a case or agree to licensing terms for, say, $100,000, rather than fight, said Christopher Marlett, CEO of MDB Capital Group, an investment banking firm that focuses on intellectual property. Seems unfair, but often heading into the courtroom is a roll of the dice.

"What happens in that courtroom is that it's a very technical presentation to a jury that has no technical background," said Marlett. "In a lot of these cases, the juries say this is above my head, and the judgment goes to the lawyer they like the most. That introduces great risk into the equation." If these claims were decided by a panel of technical experts, the fight would be worth it. But a jury of your peers, who aren't exactly your technical peers? Maybe that's something to be avoided.

That settling a dispute regardless of whether you have done anything wrong isn't exactly a revelation, of course. But the AIPLA's numbers -- the most recent data available -- show just how expensive the process can be. Fighting a patent suit can cost at least twice as much as a trademark infringement suit or a copyright infringement suit. Patent claims are the financial back breakers of all intellectual property suits and while actual costs haven't changed much in the last six years (see chart above), they're still scary.

So what do you do about it? A startup has two choices: You either roll the dice, do your own due diligence, and hope you got it right, or you cough up a good chunk of money to have someone else do it for you. Marlett's company will conduct a "freedom to operate" search before a company launches to make sure that whatever it's building isn't infringing on known patents, nor are its partners. It's not cheap. A typical survey will cost about $100,000.

Sounds expensive, but he argues it's worth it. "It's sort of like going and building a $5 million house and not buying fire insurance," Marlett said, "It's the cost of doing business. You want to protect your assets."

There's a flip side: As much as investors wail about the ruinous state of the patents, it can also work in a small company's favor. Take VirnetX, a small company Marlett advised. VirnetX in its early days aggressively patented technology that created virtual private networks over the Internet. It wasn't long before nearly every big tech company was doing the same. VirnetX eventually sued Microsoft and won a settlement for $200 million. Now it's suing Apple, Cisco, and other big companies. Now the publicly traded company is worth $1.2 billion.

"If that (intellectual property) strategy was not in place," Marlett said, "it would have been worth zero."

Are they patent trolls because they sued over intellectual property? VirnetX certainly wouldn't say so. They'd argue big companies were stomping on their rights. For about $10,000 (the typical legal costs of a patent application), a patent owner gets 20 years of exclusive ownership of an idea. The clock starts ticking the minute you apply for the patent. "The whole idea of exclusive rights in the patent law is to provide an incentive for innovation to arise, and it's a limited right," said Crowne.

Take that away, and why invent? You can certainly point to overly broad patents and a system that so often seems to reward brain-dead-obvious patents (a means of placing ads on a Web page, anyone?), but at the heart of patents is a process meant to give a financial reward to great ideas. Instead, let's attack a system that hasn't kept up with the times and so often seems to threaten the little guys.