(Fortune) -- It's been hard for Pfizer, the world's largest drugmaker, to catch a break lately.

For one thing, the FDA's drug safety arm is questioning the company's newest potential blockbuster, the anti-smoking pill Chantix. Next, in what amounts to a massive marketing failure, Pfizer said last month it would stop selling its Exubera insulin inhaler.

What's more, in Nigeria, where Pfizer faces allegations that a test of its experimental meningitis medicine, Trovan, injured and killed children more than a decade ago, settlement talks over the Nigerian government's demand for $9 billion in damages have broken down.

That trifecta of bad news would whack any company's shares, but it's been especially hard on Pfizer (Charts, Fortune 500). The company is about to lose patent protection on its best-selling drug, the cholesterol-lowering Lipitor, in two short years - and has very little in its pipeline to replace it. Lipitor generated 27 percent, or nearly $13 billion, of Pfizer's 2006 revenues.

On the heels of the FDA's Nov. 19 Chantix warnings, Pfizer shares hit a year-and-a-half low of $22.24. Bargain hunters swooped in last week and pushed company shares up 6 percent, but they're still down 28 percent in five years.

Even so, there are plenty of reasons to think Pfizer is a steal right now. For starters, Pfizer boasts a price-to-earnings ratio of more than 11, which is well below the industry average of roughly 19. The company also offers a generous dividend yield of more than 5 percent.

But there are more fundamental signs that Pfizer is headed for an upswing. The company is doing a far better job of leveraging its $7.6 billion research and development budget while cutting costs - a move that should silence critics who complain that Pfizer is good at selling medications, but bad at developing new ones.

Last week, for instance, Pfizer's newly appointed R&D chief Martin Mackay told investors at a meeting in Hong Kong that the drugmaker is targeting China, India, Japan, and South Korea for its R&D. The region is known for its R&D expertise, but is cheaper to operate in than either Europe or the United States.

At the same time, Pfizer's campaign to reduce research costs dovetails with an innovative strategy to boost its clinical successes. To that end, Gene Logic, a small biotech, last week said it had filed a patent on Pfizer's behalf for an experimental drug to treat solid tumors.

The Pfizer-Gene Logic partnership is part of a new phenomenon called "drug repositioning," in which a larger drug company hires a small firm with genetic expertise to locate new uses for a formerly discarded drug compound.

In this case, Gene Logic took on a drug compound that Pfizer had tested and rejected (Pfizer won't say what the initial intended use was). Pfizer will now put the compound through animal and human clinical tests in the hopes that it can someday seek FDA approval for it as a treatment for solid tumors.

Gene Logic will receive an undisclosed payment for its work on Pfizer's potential tumor drug, as well as a percentage of sales if the new drug makes it to market. Pfizer, in turn, may have found a way to turn its vast vault of failed medicines into a source of future revenues, with little upfront investment.

While Gene Logic isn't the first biotech looking to profit from other companies' failed compounds, its newfound use for Pfizer's treatment is the first public example of a repositioning partnership that has resulted in a potential new drug. Gene Logic CEO Charles Dimmler III says the company has similar deals with Abbott (Charts, Fortune 500), Eli Lilly (Charts, Fortune 500), and Roche, among others, but won't disclose details.

"We consider the Pfizer patent application to be proof-of-concept for our approach to repositioning," Dimmler said. For every three compounds the company tests, Dimmler says, Gene Logic finds one drug that it considers worth pursuing.

A radical plan to lower drug costs

In another example of deft partnering, Pfizer has been working with researchers at MIT for the last three years to solve another costly R&D problem: Toxicity, which is the primary reason many medicines fail laboratory tests. Right now, toxicity isn't usually discovered until human and animal testing takes place, a hugely expensive undertaking that occurs late in the development process.

MIT researchers now say they've found a way to model human cell tissues and closely replicate the liver, which is tested for toxicity. As a result, Pfizer may be able to detect drug toxicity earlier in the development process. "These models capture the complexity of what happens in the liver," says Linda Griffith, who, along with collaborator Steven Tannenbaum, plans to start a small biotech company around the idea in 2008 (Pfizer will be an investor). "They could easily be used to help predict how humans might react to a new drug."

For all of Pfizer's innovation on the R&D front, few investors are impressed. Most Wall Street analysts have a "hold" rating on the stock, and the few mavericks who are recommending "buy" are lukewarm. James Kelly, a Goldman Sachs analyst, has a twelve-month price target of $29 (last week it closed at $23.76.).

But now might just be the perfect time to bet on Pfizer. Aside from its low price-to-earnings ratio and generous dividend, Pfizer has more than $20 billion in cash with which, through some smart acquisitions, to buy its way out of its doldrums.

Meanwhile, though, the company is tackling what's been its main weakness in recent years: R&D.