The year is nearing its end, and now is a good opportunity to look at what happened throughout the 2012 to the stocks you follow. If you know the important things a company achieved, as well as any challenges it failed to overcome, then you can make a better decision about whether it really deserves a spot in your portfolio.

Today, I'll look at Merck (MRK 0.10%), a member of the Dow Jones Industrials (^DJI -0.11%). The pharma giant has faced a lot of uncertainty due to the patent expiration of some of its best-selling drugs. But throughout the year, the stock has performed quite well. Below, you'll find more on what moved shares of Merck in 2012.

Stats on Merck

Year-to-Sate Stock Return

23.9%

Market Cap

$136 billion

Total Revenue, Trailing 12 Months

$47.8 billion

Net Income, Trailing 12 Months

$6.78 billion

1-Year Revenue Growth

0%

1-Year Normalized Earnings Growth*

(1.8%)

Dividend Yield

3.8%

CAPS Rating (out of five)

****

Source: S&P Capital IQ. *Adjusted to exclude unusual items.

Why has Merck taken off in 2012?
Merck has faced a pretty dramatic patent cliff recently. Just this year, sales of two of its leading drugs, Singulair and Remicade, tumbled as patent protection ended. Singulair, having just gone off-patent near mid-year, has already shown marked declines.

But the drugmaker has found success elsewhere. Diabetes drugs Januvia and Janumet have seen greatly increased sales. Moreover, the company has a strong stable of pipeline drugs in development, ranging from cancer-fighter vintafolide -- now in Phase 3 trials -- to osteoporosis drug odanacatib. In particular, the insomnia treatment suvorexant has done well in Phase 3 trials and could potentially crush competing products from Sanofi (SNY -2.27%) and Pfizer (PFE -0.19%).

Still, Merck faces some risks in its existing drug line. Teva Pharmaceutical (TEVA) and Impax Laboratories have sued Merck to try to invalidate patents on its strong-selling Vytorin and Zetia drugs. If the suits succeed, then Merck may face an earlier-than-expected loss of revenue from these blockbusters.

Merck's great performance in 2012 owes to investor optimism that it can weather its patent cliff. If the company keeps executing well, then 2013 could be equally fruitful for shareholders.

Click here to add Merck to My Watchlist, which can find all of our Foolish analysis on it and all your other stocks.