These three companies just didn't live up to Mr. Market's expectations last week. Whether the target was set by the company's own management, by Wall Street analysts, or by the market at large, that miss can have serious consequences.

Sometimes an earnings stumble is a signal to sell, but digging in the dirt is also a good way to find turnaround candidates while they're getting beaten down. Today, we'll start with a familiar name, go on to a technology that may be closer to you than you think, and end the day working in a coal mine. That's just the way the cookie crumbles.

Drove my Chevy to the levy, but...
Unless you've been living under a large rock in the Mojave desert, you already know that General Motors (NYSE:GM) failed to live up to expectations last week, though the company did turn a small profit. Thirty-two cents per share didn't excite the analysts, who had settled on a $1.19 consensus, excluding special items like the sale of half of the GMAC financing division.

That segment, for once, was the culprit in the earnings miss, too. When GM's car and truck sales were slow, GMAC was often held up as the company's saving grace, the one thing that was right in Detroit. But now that the housing market has started its collapse and loan delinquencies are reaching multiyear highs, those home loans have become a drag on earnings.

CEO Rick Wagoner explained that GM's 2006 performance "reflects the significant progress we've made toward transforming GM into a more competitive, global business focused on long-term, sustainable success. It's validation that our strategy is working, and faster than many people thought possible."

Under heavy pressure from foreign auto makers like Toyota (NYSE:TM) and Honda (NYSE:HMC), General Motors has responded by cutting costs and renegotiating supply contracts, all in order to trim the fat and put the world's largest vehicle maker back on solid ground after a few shaky years.

It looks like the partial GMAC sale happened at an opportune time, and it's going to take a while for the mortgage market's woes to sort themselves out. The private-equity buyers may be left holding a substantial part of a losing deal for several quarters, maybe even years.

So, is this the right time to invest in General Motors again? The company is doing many things right but is still saddled with real problems in its pension plans and, some would say, in car design. The stock is trading at less than one-third its 2000 peak price, but it's still hard to call it cheap today.

The world's No. 1 automaker posted net income of $950 million, or $1.68, but that was helped by the sale of 51% of its GMAC finance arm during the period.

Excluding special items, earnings came in at $180 million, or $0.32 a share. That's a big improvement from the loss of $936 million, or $1.66 per share, on that basis a year earlier, but well below the $1.19 a share that analysts surveyed by earnings tracker First Call had been forecasting.

The company's North American auto operations nearly broke even in the fourth quarter, reporting a net loss of $14 million versus an adjusted loss of $1.4 billion a year earlier.

Meet the new boss, same as the old boss
Let's move on to OpenTV (NASDAQ:OPTV), the second disappointment on our menu. The maker of software for the set-top boxes in our living rooms posted a $0.03 loss per share, three times the red ink expected by Wall Street, and down from last year's essentially break-even pro forma earnings.

Somehow, management spun this underperformance into a "record performance," based on revenue growth and ignoring the bottom line. This is the newly installed CEO Alan Guggenheim talking, not the old executives or board members.

Swiss digital security firm Kudelski took a nearly 75% voting stake in OpenTV to replace the old leadership, but if the best they could find was a glib bobblehead set on appeasing short-term market demands rather than focusing on long-term performance, well, see the heading above. If you're interested in the set-top software market, you'd probably do better to look at Cisco (NASDAQ:CSCO) with its Scientific-Atlanta and PowerTV properties. Next song!

Working in a coal mine
James River Coal
(NASDAQ:JRCC) rounds out our selection this week, having reported a $0.99 loss per share when the market expected a much smaller $0.35 loss per share. Instead of improving on last year's $0.60 per-share loss, things got worse.

So, what happened? James River increased both unit volume and average selling prices, so revenues increased by a strong and organic 21%. But the company adjusted its mining plans to account for soft demand and new regulations, incurring an unexpected $8.9 million, or $0.53 per share, in labor and restructuring costs. Back that out, and you get a more reasonable, though still somewhat disappointing, $0.46 loss per share.

In return, these changes have improved "the labor situation throughout Central Appalachia," where the company's coal mines are located. Overall, the company has impressed our Motley Fool CAPS players, who have rated the stock "outperform" nearly in unison and in impressive numbers over the last couple of months.

Overall, the labor and operating improvements are expected to balance out the costs of their own implementation, and management stands by its positive outlook for the full year. Judging by the CAPS data, coal is a promising industry right now, with most companies in the sector earning at least three stars -- and some, like Arch Coal (NYSE:ACI) sitting on five stars. James River is a three-star stock today.

Back on the chain gang

Some of these underperformers are victims of larger circumstances, while others might have only themselves to blame. It's up to you to decide which down-on-their-luck companies should be able to pull themselves up by the bootstraps and which really are stuck in the mud. Come back next week, and we'll take a look at another batch of mishaps and disappointments. It'll be fun and educational.

Further Foolishness:

Seeking great deals on unfairly punished stocks? Philip Durell and his merry band of Fools at the Motley Fool Inside Value newsletter service are standing by to help you find great stocks at ridiculously low markdowns. Try a 30-day trial subscription to see whether bargain-hunting is right for you.

Fool contributor Anders Bylund holds no position in the companies discussed this week, and he really should leave Chrissie Hynde out of his articles. The Fool has a disclosure policy, and you can see his current holdings for yourself.