North America's Class I railroads run a predictable and straightforward business, but the same can't be said of their stock price. Companies such as Norfolk Southern (NYSE: NSC) have been in freefall recently, with shares falling more than 12% in a week. Investors are nervous about weakness in the global economic recovery generally, but most specifically about the decline of the railroads' most important revenue driver. Despite these fears, however, railroads enjoy insurmountable barriers to entry and a bright future as trade recovers. Recent weakness might just present a great buying opportunity.

Freight falters
Intermodal cargo is an important revenue source for railroads, but it leaves them sensitive to weak consumer demand. In September, two reports came out from the New York and Philadelphia Federal Reserve banks indicating that manufacturing output was down in those regions, continuing a national trend. Depressed manufacturing means fewer industrial inputs are being shipped to factories, fewer finished goods are being shipped to consumers, and lower revenue is resulting for transporters.

Markets got a reminder of this weakness when freight shipping and logistics operator FedEx (NYSE: FDX) cut guidance, projecting that global trade will remain weaker than anticipated. CEO Fred Smith confirmed that declining industrial activity, as well as a slump in Chinese growth, would hurt the company's earnings. The company also predicted that the Federal Reserve's estimates for economic growth in 2012 and 2013 are too optimistic. FedEx, as one of the world's largest movers of goods, has great data on global demand for products, and a gloomy outlook from the company could foretell tough times ahead for freight transporters.

King Coal dethroned
The day after FedEx's announcement, Norfolk Southern slashed its own earnings guidance, specifically blaming low volumes of coal. Coal shipments are critical for many railroads: Norfolk Southern and CSX (NYSE: CSX) are particularly dependent, with Appalachian coal providing more than 30% of revenue.

Coal is primarily used for electricity generation, and its weight makes railroads the most viable way of transporting it. This has been a windfall for the rail industry, but coal has always been among the most environmentally harmful energy sources, a reality that has led successive administrations to pass tough new rules regulating the burning of coal for electricity. Utilities such as Duke Energy (NYSE: DUK) have fought such regulations for years, because coal has historically been the cheapest energy source. No more.

The advent of hydrofracturing, a process for extracting gas from shale formations, has allowed for record production, soaring supply, and plunging prices for natural gas. Natural gas is now not only the cleanest hydrocarbon but also the cheapest. Coal stalwarts are responding: Duke Energy will retire the Dan River coal station, for example, and replace its capacity with a new natural gas facility. Industry analysts don't expect another coal plant to ever be built in the United States, and railroads will need to face that reality.

Keep chugging along
The common thread in these challenges to railroads, however, is that they were both foreseeable. Slow economic recovery and the decline of coal have been years in the making, and investors should have already priced these dangers into railroad stocks.

I haven't been an owner of railroad shares for some time now, simply because I thought the market wasn't correctly pricing in these short-term troubles. Norfolk Southern's announcement changed all that. With most railroads down hundreds of basis points over the past week, I think it's time to reconsider.

American railroads' advantages are considerable. Compared with trucking, railroads enjoy a fourfold advantage in fuel efficiency and lower labor costs per ton, making them much more competitive for long distances and heavy goods such as commodities. Strong property rights make it next to impossible for potential competitors to put together the rights-of-way required to enter the railroad market, giving railroads a monopoly in their geographies.

And railroads will not be short of business opportunities. Despite the decline of American coal usage, China is expected to drastically increase its coal import and consumption. Coal terminals are under construction on the West Coast, and railroads may soon be shipping massive volumes of coal for export. In other sectors, rising global populations will trigger demand for the bulk agricultural products that American railroads move, and rising incomes will drive intermodal traffic higher. It's safe to say that when global trade recovers, so will railroads.

My favorite railroad today is Canadian National (NYSE: CNI). It's more expensive than some competitors: It trades for 14 times forward earnings, compared with less than 10 times forward earnings for Norfolk Southern or CSX. However, with a product mix low in coal (under 10%), a favorable geography providing access to West Coast ports, and some of the highest operational metrics in the industry, I'm willing to pay up for quality.

Of course, any investment in railroads is tightly geared toward the energy markets, as the railroads are so exposed to energy prices for both revenue and costs. One Motley Fool analyst believes that the era of cheap natural gas could end as soon as 2014, and he's identified one stock you need to own before then. This report is free, but it's available for only a limited time, so get your copy today.