During the past several years, a lot of obstacles have marred the road for Japanese auto giant Toyota Motor Corp. (NYSE:TM). First came the economic crisis of 2008, which stalled the entire auto market — so much so that rival General Motors (NYSE:GM) drove itself into bankruptcy. Then just as the recession began to recede, Toyota was slapped by a recall scare over so-called “unintended acceleration” in some of its models. The unintended acceleration cases were later determined to be caused by driver error, but that was after substantial damage was done to Toyota’s bottom line, as well as to the value of its stock price.

Toyota’s real problems, however, came courtesy of Mother Nature.

Last year’s devastating earthquake/tsunami/nuclear disaster in Japan nearly decimated the company’s production lines. To make matters worse, horrific flooding in Thailand shut down many of Toyota’s electronic components suppliers. Then on top of all that, the value of the yen began to rise vs. rival foreign currencies, and that also weighed on Toyota’s profits.

Given all of the potholes placed in Toyota’s path in recent years, you might think the company and its stock should just be parked and forgotten about. Of course, if you did that now, you’d be making a wrong turn.

Click to Enlarge So far in 2012, TM shares have surged more than 18%. That’s double the outstanding gain experienced by rival Japanese automaker Honda (NYSE:HMC), which has seen its shares rise about 9% year-to-date. GM shares have climbed a much more modest 6%, and Ford (NYSE:F) actually has seen its stock decline nearly 4%.

Perhaps the biggest positive going forward for Toyota came with its release of fiscal fourth-quarter earnings. For the quarter ended March 31, the company reported earnings of ¥121 billion, or $1.52 billion, which is nearly a five-fold increase from a year earlier when it earned just ¥24.5 billion. More importantly, this was the first quarter since fall 2010 where we’ve seen a year-over-year increase in earnings.

Toyota also said it expects earnings in the current fiscal year to come in at ¥760 billion, or $9.55 billion, up from the ¥283.5 billion it earned in the prior year. By comparison, GM is expected to earn about $7.8 billion this year.

Of course, it’s pretty easy for Toyota to outdo itself compared to last year, especially given the problems that hampered the company in 2011. The real test for Toyota going forward will be if it can best its rivals in terms of capturing market share, and if it can increase sales of its flagship Camry and Prius brands.

So far, Toyota is accelerating on both of these fronts. Although its newly designed Camry model was panned by automotive critics, buyers have embraced the brand once again. The new Camry, which features several technology enhancements and better gas mileage, has been a big hit with U.S. buyers. As for the Prius, Toyota has introduced several new models of its popular hybrid brand, such as the larger Prius V, and the smaller, more affordable, Prius C. The company already has seen strong early sales for both models, and that has led to a big boost in U.S. sales of the premier hybrid brand.

According to Toyota Motor Sales USA, domestic sales rose 11.6% in April vs. a year ago, with Camry sales up 36.1%. The newly enhanced Prius line saw a spike in sales of 126.9%. If sales metrics continue improving like this — and if buyers keep showing a willingness to get behind the wheel of a new Toyota — then the company likely will look back on the period between 2008 and 2011 as just a bad memory.

In fact, Akio Toyoda, chief executive at Toyota and the grandson of the company founder, acknowledged as much in his prepared remarks accompanying the latest earnings release, saying, “In recent years, we have suffered periods of hardship. This year, I am determined to show tangible results of all our internal efforts in order to reward our stakeholders who supported us during these difficult times.”

If the Toyota chief makes good on his pledge, TM shares could deliver big time.

As of this writing, Jim Woods did not hold a position in any of the aforementioned securities.