On Friday, BlackBerry released jaw-droppingly awful third-quarter results. The company's prospects look grim. But if it follows the example set by IBM two decades ago, it can pull out of its tailspin.

On July 27, 1993, IBM posted one of the largest quarterly losses in American corporate history: $8 billion. After decades as the dominant firm in the computer industry, IBM and its clunky mainframes had fallen behind the technological curve. The same day, the company announced that it would eliminate another 35,000 jobs, on top of 100,000 jobs that had already been cut since 1986.

The day would prove to be Big Blue's low point. The company returned to profitability in 1994 and would grow steadily for the rest of the 1990s. Gradually, IBM realized that its most important asset wasn't its hardware or software but its deep ties to large companies that needed help managing their IT systems. IBM's new niche as a technology-agnostic consulting company has proven more stable and profitable than the turbulent hardware and software markets have ever been.

BlackBerry is facing a crisis a lot like the one IBM faced two decades ago. On the surface, the company's third-quarter results look like a disaster. Revenues were $1.2 billion, a 56 percent drop from the third quarter of 2012. Thanks in part to extensive write-downs, the company lost $4.4 billion.

Yet the company's stock rallied on the news. By closing bell, shares were up more than 15 percent. That's largely because the market already knew BlackBerry's prospects were grim. But it may also be because Friday's announcement suggests the the company has a plan to deal with the crisis.

The key to IBM's turnaround was a realization that its fortunes were no longer tied to any specific technology platform. The old IBM built proprietary technologies and tried to lock their customers into using them forever. That worked great in the 1960s, when IBM's mainframe computers were at the cutting edge. But by the 1990s, many of the firm's homegrown technologies were subpar. Trying to solve customers' problems entirely with IBM gear was a liability.

Luckily, the deep relationships IBM had built with large customers meant that technological lock-in was no longer so important. Large corporate clients hate switching IT systems, so as long as IBM continued to meet their needs, they could count on having their contracts reviewed. That realization freed the company to become more ecumenical about the technology it sold to customers.

One sign of this changed thinking came in 1999, when IBM embraced the open source Linux operating system. Such a move would have been unthinkable two decades earlier, when IBM focused on selling IBM software running on IBM hardware. But the company realized that these technologies were becoming commodities. The real money was in helping companies find the best technology and make it work well together.

As the new century dawned, the compamy started looking for ways to get out of the hardware business altogether In 2002, it sold its hard drive business to Hitachi for $2 billion. IBM's PC business was auctioned off to Lenovo in 2004. In 2007, IBM spun off its printer division to Ricoh. As a result, IBM has become increasingly focused on selling technical advice and support, rather than just hardware or software.

A similar approach is BlackBerry's best chance of survival. The BlackBerry platform is never going to catch up to Apple iOS or Android, and indeed, it will be lucky to even survive the decade. But the BlackBerry corporation has deep ties to large corporate and government clients who like its enterprise software, which helps corporate IT departments manage large numbers of mobile devices. As the mobile market gets ever more complicated, these enterprise software and services will only get more valuable.

It's also not a market that either Apple or Google is likely to serve well. These companies are skilled at selling their mobile platforms to ordinary consumers, but they've never been good at pitching products to corporate IT departments. That creates an opening for third parties like BlackBerry.

But for BlackBerry the company to survive, it needs to distance itself from BlackBerry the technology platform. In a world dominated by iOS and Android, BlackBerry's enterprise software will need to support these platforms as well as they support their own mobile operating system. As long as the same company is making both product lines, there will be a temptation for favoritism.

Today BlackBerry announced an important move toward separating its mobile device business from its enterprise software business. The company is working with Foxconn to manufacture BlackBerry devices. That could be a first step in spinning off BlackBerry's hardware division entirely, letting some other company deal with the headache of managing the platform as it becomes increasingly marginal. That will free BlackBerry up to focus on where the real money is: helping companies manage their mobile devices, no matter what operating system they run.