Despite their blistering rise today, the shares of airline stocks like AMR (NYSE:AMR) and UAL (NYSE:UAL) had appeared to be in some sort of medieval torture device over the past year because of  relentless fuel prices. Not surprisingly, gas-guzzling shippers like FedEx (NYSE:FDX) are also feeling the pinch.

It seems rail operators are not immune, either.

Canadian National Railway (NYSE:CNI) reported second-quarter earnings of $0.95 per share on Monday. While the results were better than analysts had anticipated, earnings fell 11% from the corresponding quarter in 2007.

The reasons for the decline are clear. Despite rate hikes and fuel surcharges, fuel costs were a major drag on the bottom line. Fuel costs rose 60% from the prior year, reaching $400 million, compared with the company's $2.1 billion in revenue. The operating margin contracted accordingly, from 40% to a still-healthy 33.7%. Ironically, the very same weakness in the U.S. dollar that is partly responsible for the ascent of oil dealt Canadian National a second blow when the company repatriated revenue into the stronger Canadian dollar. The greenback's slide to parity with the Canadian dollar cost the company $25 million in the quarter.

Despite these two inter-related bites out of the bottom line, Canadian National remains the same great company that made the final four in the 2008 Motley Fool Stock Madness challenge. The company's CEO applauded "double-digit growth in intermodal revenues as a result of new container traffic … as well as higher volumes of commodities to support oil sands development in Alberta." It appears Canadian National also dodged major impacts from recent Midwest flooding that led competitor Burlington Northern Santa Fe (NYSE:BNI) to lower guidance and prompted analysts to trim expectations for Norfolk Southern (NYSE:NSC) and CSX (NYSE:CSX).

Fuel prices have put the squeeze on a lot of transportation companies, but with strength from commodities demand and intermodal shipping, I consider Canadian National to be up for the challenge. 

Further Foolishness:

FedEx and Canadian National Railway are both Motley Fool Stock Advisor recommendations. Try the market-beating newsletter service free for 30 days.

Fool contributor Christopher Barker captains yachts and writes about stocks. He can also be found blogging actively and acting Foolishly in Motley Fool CAPS under the username TMFSinchiruna. He owns no shares in the companies mentioned. The Motley Fool has a disclosure policy.