The most popular smartphone at this year's Consumer Electronics Show in Las Vegas didn't run Google's (Nasdaq: GOOG) Android or Apple's (Nasdaq: AAPL) iOS. Instead, former titans Microsoft (Nasdaq: MSFT) and Nokia (NYSE: NOK) stole the show with a new phone and OS, after watching their two biggest rivals eat their lunch for the past five years. Shoring up its slender slice of the smartphone market will help Microsoft in the long run. But Nokia needs to succeed here far more quickly -- and more desperately.

Dinosaur, meet comet
Five years ago, Nokia owned the mobile-phone industry. In Q2 2007, it raked in 60% of the profits from all handsets sold; in Q3 2007, it commanded 38% of the market for handset sales -- more than its next three competitors combined. But by the end of 2011, Nokia earned just 2% of all handset profits, while its share of global smartphone sales had shrunk to 23.9%.

What wounded its sales so gravely? Apple rolled out its first iPhone in 2007. Google swiftly followed with Android, a free OS that flourished on handsets from a multiple manufacturers. As of December 2011, Android represented more than half of U.S. smartphone sales, according to NPD. Apple commanded 29% of sales -- and two-thirds of all profits in the entire mobile-phone business. While other manufacturers built increasingly sophisticated phones for Android, Nokia stuck with its own proprietary operating systems, which began to lose ground against Apple and Android's popularity.

Still No. 1 -- but falling fast
Overall, Nokia still sells more mobile phones than anyone else. It moved more than 105 million units in Q3 2011 alone -- 34% more than its archrival, Samsung. But only 16.8 million of those were high-margin smartphones; cheap, low-margin "feature phones" made up the rest.

In 2010, mobile-phone sales represented 68% of Nokia's revenue. Total revenue from its mobile phone sales grew 16% from 2007 to 2010. But its operating margin shrank from 21% to 11% for mobile phones alone, and from 15.6% to 4.9% for the whole company, during that period. As its NAVTEQ and Nokia Siemens Services divisions post steady losses, the company's getting killed.

Nokia's shares have fallen nearly 74% in the past five years. No wonder Nokia CEO Stephen Elop, just before announcing Nokia's new partnership with Microsoft in February 2011, compared his business to a burning oil rig.

The empire strikes back
In exchange for a reported $1 billion or more in cash, and additional revenue-sharing pacts to sweeten the deal, Nokia pledged to exclusively support Microsoft's Windows Phone mobile OS. Its first flagship phone for that partnership, the Lumia 900, debuted at this year's CES to critical raves.

Where many previous Windows Phones reportedly felt underpowered, the 900 offers top-notch cameras, a big, bright screen, and support for wireless carriers' new 4G LTE networks. (Some Android phones can use 4G, too, but the iPhone remains 3G-only.) Photos of the 900 look sleek, colorful, and -- unlike many Android handsets -- nothing like an iPhone clone. PCWorld magazine's Ginny Mies proclaimed it "the Windows Phone I've been waiting for," while Wired's Christina Bonnington called the 900 "potentially stellar."

Nokia hasn't announced a release date yet, but at least one pundit believes the Lumia 900 could arrive by March 18. Microsoft and Nokia have reportedly prepared a $200 million marketing push to sell as many Lumias and other manufacturers' Windows Phones as possible. One Morgan Stanley analyst expects Nokia to ship 37 million Windows Phones this year, and more than 100 million over the next two years.

But will it be enough?
Morgan Stanley's estimates would still represent far fewer smartphones than Nokia sold in the past year, before its Windows deal took effect. However, that number doesn't include any remaining Symbian phones, which the company's still selling for the time being. In addition, the new Windows Phones may carry higher margins for Nokia. Better yet, its deal with Microsoft will help the company cut its development budget for its own mobile OS, and bring in new ad, search, and navigation revenue, all of which could help boost its bottom line.

However, Nokia isn't the only company making phones for Microsoft's OS. Rivals are already rolling out their own impressive offerings, including HTC's gargantuan Titan II. So even if Windows Phone itself succeeds, Microsoft's victory could only lead to more rivals, fiercer competition, and potentially lower margins for Nokia. It'll have to keep making exceptional phones to stay at the head of this particular pack.

To shore up its stock price and salvage its increasingly tarnished reputation, Nokia needs the Lumia 900 to win big, right out of the gate. Nokia investors should keep a keen eye on the company's sales. If the new Lumia line succeeds, the prestige and confidence it creates among customers, developers, and investors could drive Nokia's shares higher. But if it flops, Nokia will find itself right back on that burning oil platform -- with nowhere left to jump.

Whoever wins or loses in the ongoing smartphone struggle, our ace investors have found three stocks poised to profit as more and more of our computing moves to mobile devices. Discover their names, and see why our team likes their chances, by joining the thousands of Fools who've already grabbed a copy of our special free report.