CSX Corp.'s (CSX) third-quarter profit dropped 23% as revenue and volumes dropped by double digits for the third consecutive quarter. But the company said it believed the worst of the recession was over.

Shares were up 2.3% at $45.30 in after-hours trading as earnings topped Wall Street's expectations. The stock is up by about a third this year.

The railroad company said while volumes declined across the business, the rate of decline continued to slow in nearly all markets. Still, President and Chief Executive Michael Ward warned of weak demand for CSX's coal business "well into 2010."

The third-largest U.S. railroad by revenue reported earnings of $293 million, or 74 cents a share, down from $380 million, or 93 cents a share, a year earlier.

Revenue dropped 23% to $2.3 billion amid a 15% decline in volumes. In July, the company foresaw a double-digit drop in third-quarter shipping volume, but the decline was lower than the first two quarters of the year.

Analysts surveyed by Thomson Reuters expected per-share earnings of 71 cents on revenue of $2.32 billion.

A number of top railroad executives have said freight volumes have been improving, although the industry has been more skeptical about a dramatic rebound. Last month, Ward described the recovery as "an elongated L," meaning he doesn't expect a quick recovery.

Still, CSX's results have been helped recently by furloughing workers and cutting other costs and raising prices. In the latest quarter, CSX cut operating costs by 24%.

-By John Kell, Dow Jones Newswires; 212-416-2480; john.kell@dowjones.com