The fracking-driven boom in oil and gas production has turned North America's energy geography on its head. The center of oil production has shifted northward, from the Gulf Coast to landlocked oil fields in North Dakota and Alberta, Canada. The infrastructure to deal with this energy production, however, is still concentrated in the old production heartland. That means oil needs to get from the remote northern fields where it's being produced to refineries, chiefly on the Gulf and Pacific coasts. As proposed pipelines languish in bureaucratic red tape, the industry has started to look at a transportation alternative that already has its infrastructure in place: trains. The oil-by-rail business has exploded in recent years, and looks set to rise ever higher.

Today, rail handles only a fraction of the oil volumes moved by pipelines, and pipelines still enjoy a cost advantage: shipping diluted bitumen from Canada's tar sands to high-capacity refineries on the U.S. Gulf Coast, for example, still costs $10-$15 more by rail than by pipeline. That cost advantage is why producers have been pushing big projects like TransCanada's (TRP 1.16%) Keystone XL, a proposed pipeline that would transport 830,000 barrels of heavy crude from Western Canada's tar sands to Nebraska and ultimately Gulf Coast refineries. While Keystone XL would be more price competitive than rail if it ever gets built, the fact that it has not yet been approved for construction after being proposed in 2008 and expected to finish construction and come on line last year demonstrates the single greatest advantage of rail: price aside, the infrastructure to move oil is already there.

As pipelines have languished, producers have sought out any means to get their product to market, and that's been good for rail. With significant trackage throughout oil-producing areas, rail lines were able to quickly and flexibly absorb higher oil shipments, skyrocketing from moving 9,500 carloads of crude oil in 2008, the year Keystone XL was proposed, to an astonishing 234,000 carloads in 2012. In 2013, the Class I railroads are on track to deliver over 400,000 carloads of crude. This has driven rail's share of U.S. crude oil transportation up from near zero to over 11% in just five years. Similarly, crude oil has risen from being just 0.03% of all Class I railroad carloads in 2008 to 1.5%. That's very rapid growth from a tiny base, but the rail industry has the capacity to handle much, much more.

Unlike in the pipeline business, the rail industry already has a vast trackage network with unused capacity, as well as the rights of way to build or restore additional trackage, making it much easier for rail to move quickly to take delivery of production from new oil fields. The biggest infrastructural bottlenecks in ramping up oil-by-rail shipments are the number of tanker cars capable of transporting crude, and the availability of rail terminals at refineries, which are basically just additional siding for trains to park while being off-loaded. Compared with building new pipeline, these are relatively easy hurdles to overcome. A producer wishing to create a new oil transportation route simply needs to contract more tanker cars and invest in new rail siding at the refinery. Since rail terminals usually do not require environmental impacts, this process can often be completed in a year or two.

This dynamic is playing out now in Western Canada over Enbridge's (ENB 2.83%) controversial Northern Gateway Pipeline, a project announced in 2006 to transport bitumen from the tar sands in Alberta to a marine terminal in British Columbia, where it would be exported to Asia. After years of decade of environmental opposition and regulatory runaround, the Canadian government approached Class I rail titan Canadian National (CNI 0.39%) over a oil-by-rail proposal. Canadian National asserts that it has ample capacity run seven trains per day to match the Northern Gateway's proposed capacity. While a new rail terminal would be required at the export terminal to offload the crude, actually transporting the oil by rail would not trigger a new federal environmental assessment, unlike the pipeline project.

While still an admittedly small piece of business for the railroads, the booming shale oil story presents a huge future opportunity. The sky-high gains in volume and market share over the past few years may seem unsustainable, it's undeniable that rail is handling the growing oil output much more flexibly and reliably than pipelines. Canadian National and Canadian Pacific (CP 0.88%), another Class I railroad with significant exposure to Western shale oil fields, indicated to the Canadian government that "the potential to increase rail movements of crude oil is theoretically unlimited." It's not every day that such staid, stolid businesses as railroads note so much potential.