Norfolk Southern Corp posted a 24 percent rise in quarterly income that beat Wall Street expectations as demand for shipments like chemicals, construction materials and automobiles more than offset a dip in coal volumes.

Shares of the company rose 3.7 percent to $92 Wednesday before the markets opened.

The railroad, which is planning to increase investments by 12 percent this year, said strong crude by rail shipments and a higher automotive production helped boost traffic volume by 8 percent in the quarter.

Coal was the only commodity that saw a dip in demand in the fourth quarter—revenue fell 2 percent. But general merchandise revenues were 12 percent higher than last year.

Weak coal shipment volumes have been a problem for Norfolk Southern and rival CSX Corp, as the shift to natural gas caused utility coal stockpiles to surge as demand for coal from power producers declined. Both railroads have been looking at rising demand for shipments of chemicals, autos and agricultural products to make up for the weakness in coal.

For the fourth quarter, Norfolk Southern earned $513 million, or $1.64 a share, up from the $413 million, or $1.30 a share it earned last year.

Revenue came in at $2.9 billion, up 7 percent.

Analysts, on average, were expecting the company to earn $1.50 a share, on revenue of $2.85 billion, as per Thomson Reuters I/B/E/S.

Shares of the company, which operates in the eastern parts of the United States, closed at $88.71 Tuesday on the New York Stock Exchange.