2012 is nearing its end, and now's a good opportunity to look at what happened throughout the year to the stocks you follow. If you know the important things that 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 CSX (CSX -3.02%). The railroad company has benefited for years from high fuel prices that make rail transport more efficient and cost-effective. But with the slowness in the global economy and especially the drop in commodity demand, CSX has faced some challenges in 2012. Below, you'll find more to explain what happened with shares of CSX this year.

Stats on CSX

Year-to-date stock return

(4.0%)

Market cap

$20.3 billion

Revenue, past 12 months

$11.8 billion

Net income, past 12 months

$1.87 billion

1-year revenue growth

1.9%

1-year net income growth

4.3%

Dividend yield

2.8%

CAPS rating

*****

Source: S&P Capital IQ.

Why did CSX slow down in 2012?
The big challenge that CSX faced this year was the huge decline in the coal industry. With natural gas prices at extremely low levels, demand for coal sank, leading to the bankruptcy of Patriot Coal and big problems for CSX customers Alpha Natural Resources (NYSE: ANR) and James River Coal (NASDAQ: JRCC). That in turn led to declines in coal shipments, which affected CSX and regional rival Norfolk Southern (NSC -3.60%) especially hard due to their proximity to the Appalachian coal region.

One area that offset some of those losses came from the drought in the Midwest. With water levels on the Mississippi River making the waterway impassable to barge traffic, railroads like CSX have had to pick up the slack in transporting goods downriver. That's more expensive for shippers, but it's given CSX some alternate means of getting goods to market.

In the long run, international expansion plans for coal companies and a rising economic tide overall will likely boost CSX's prospects. Until those plans become reality, though, CSX will have to rely on keeping costs low and making the most of its opportunities to find revenue and profit.

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