When Red Hat (RHT) reported earnings on Wednesday night, you'd have thought that the company was badly broken. Shares plunged as much as 13.4% in the first ten minutes after the release.

It seemed like an open-and-shut case. The open source software veteran reported $348 million in fourth-quarter sales, while analysts had expected $349 million. This may not sound like a huge miss, but Red Hat has a habit of exceeding revenue targets by a fair margin.

So, never you mind that adjusted earnings of $0.36 per share crushed Wall Street's $0.30 targets -- time to panic and sell! Demand for Red Hat's products and services must be falling through the basement floor.

Right?

This fedora-sporting shadow is becoming a familiar sight in data centers everywhere; 90% percent of Fortune 500 companies employ Red Hat systems today.

Not so fast!
As you might have guessed from Red Hat's bounce back to stronger share prices on Thursday, the real story isn't quite that simple -- or that gloomy.

The stock ended up 0.9% higher on Thursday, the previous night's sudden crash all but forgotten. Moreover, the after-hours plunge was paired with fairly impressive trading volume, but the climb back to positive territory came amid nearly four times the average volume. There's real conviction behind the upside move here.

How did Red Hat pull off this magic trick? It's a story of conservative accounting and more multi-year, million-dollar contracts.

Red Hat landed a record number of $5 million deals this quarter, and also broke the high-water mark for $10 million contracts. At the same time, large customers are warming up to the idea of breaking multi-million dollar contracts into several annual payments. That way, a substantial one-time cost turns into a bite-sized line item in the budget that's easier to explain to upper management, investors, and other stakeholders.

The company still gives its major customers the option to pay down large agreements all at once, but has no incentive to force it. Recording revenue early so you can sit on a swelling bank account with disappearingly small interest returns doesn't make CEO Jim Whitehurst excited. So, why not break these deals up, leaving customers to pay for multi-year licenses on a multi-year payment plan?

When you do that, you can't record all your order bookings right away. Red Hat's billings are growing right alongside recorded revenues, and the off-balance-sheet order backlog expands even faster. This is the part that caught investors by surprise: Red Hat's long-term visibility and solid orders are growing faster than the simple revenue figure seems to imply.

The (not so) secret sauce
The company thrives in good times and in bad, thanks to the unique value of its product portfolio.

In times of crisis, budget-crunched IT managers can take a look at Red Hat's low product cost to keep their operations running smoothly without a whole lot of monetary support. Red Hat Enterprise Linux is a solid alternative to full-fledged Unix implementations from IBM (IBM -9.46%) or Oracle (ORCL -1.21%). The company also wins over many Microsoft (MSFT -3.56%) Windows customers under these circumstances.

And it's not just the operating system that appeals to tight budgets: Red Hat also sells high-quality middleware products, like the Jboss toolkit, which gets bundled with about 20% of Red Hat's platform sales right now. That's a serious contender to replace IBM's WebSphere, or Oracle's WebLogic software in many cases. But Jboss subscriptions typically cost less than 10% of a WebSphere or WebLogic license.

The Red Hat appeal in hard times should be obvious: Less pressure on the pocketbook, sir. When CFO Charles Peters said that Red Hat's middleware sales were "strong despite the challenging global economic environment," I think he used the wrong word. Red Hat should never be scared of economic downturns.

What's next?
For the next quarter, management again set the bar below current Street expectations. That's alright, because those long contracts play into coming quarters, as well. In fact, many of the deals Red Hat just closed will stick around for years to come.

IBM and Oracle have beaten the market over the last five years with gains of 85% and 65%, respectively. Microsoft has traded sideways over the same period. Meanwhile, Red Hat has crushed them all by nearly tripling shareholder value.

There's more where that market-crushing performance came from, which is why I rate Red Hat "outperform" for the long term in Motley Fool CAPS. You might want to do the same