By all accounts, Plains All American Pipeline (PAA -1.11%) had a great 2012. This midstream company isn't the kind to celebrate by swigging a glass of boozy egg nog and resting on its laurels at the end of the year, however. Just last week, the partnership announced an important acquisition that will strengthen its already impressive position in the midstream game.

The deal
Plains picked up five crude oil rail terminals from the U.S. Development group for $500 million. Four of the terminals are operating, and the fifth is under construction. Three of the terminals are for loading oil, one each in the Eagle Ford, Bakken Shale, and Colorado's Niobrara region. The two unloading terminals are in St. James, La., and Bakersfield, Calif.

Once the acquisition is official, Plains rail business will sport some impressive stats, including terminals on the East, West, and Gulf coasts, a crude oil loading capacity of 250,000 barrels per day, and an unloading capacity of 350,000 bpd.

For those of us with a passion for analyst expectations, Credit Suisse responded to the deal by increasing its 2013 and 2014 EBITDA estimates for Plains by $85 million and $98 million, respectively. It popped next year's EPS estimate up $0.19 for good measure.

Is Credit Suisse overestimating this deal? Or is it a brilliant move at just the right time?

Very trendy
The move is brilliant. Plains' terminal deal is indicative of an oil business trend that's been sweeping the nation over the past year: shipping by rail.

According to the Association of American Railroads, in October petroleum and petroleum product shipments increased 54.5% year over year, to 20,906 carloads. Oil really has made itself quite comfortable on North American freight trains over the past year, and crude shipments have increased by about 360,000 barrels per day.

Not sold? Think about this: Continental Resources (CLR) is the largest oil producer in the Bakken Shale and it ships 65% of its oil out of North Dakota on trains. In Continental's case, 65% is equal to about 40,000 barrels per day and that accounts for roughly 16% of all oil produced in the Bakken.

Numbers like that illustrate exactly why Plains All American will have 6,700 rail cars under its control by the end of 2013 -- and it's not the only midstream operator hip to the train game. Enbridge (ENB -1.21%) recently announced its partnership with Canopy Prospecting to build out a rail system to transport 80,000 barrels of oil per day from North Dakota to refineries in Philadelphia by the third quarter of 2013, though capacity could double by mid-2014 if need be.

Location, location, location
The brilliance of this deal isn't that Plains purchased terminals, but rather where the terminals are located. The loading terminals are in three plays where production is growing: 50% of all rigs drilling in the U.S. right now are located in the Permian Basin, the Bakken/Rockies region, and the Eagle Ford Shale. Pipeline capacity out of the Eagle Ford and Bakken plays is extremely tight right now. If producers can get their oil into a pipeline and out to a hub, it's very likely going to Cushing, Okla., to sell at the WTI price, which is much lower than the Brent world price.

However, if producers can get their oil on a train and send it to Louisiana, it will sell at a premium to the WTI benchmark. As recently as November, deliveries at St. James were reaping $22 a barrel more than deliveries at Cushing -- far closer to the Brent price than the WTI has been in a while.

It is more expensive to ship via rail, but the farther you go, the smaller the price disparity and the greater the margin producers earn. Plus, it gets there faster.

That explains the Louisiana location, but what about Bakersfield? Quite simply, domestic oil is cheaper than the imports coming into California right now, part of the reason gas prices in California are among the highest in the country. There are no pipelines that run from the Bakken Shale to anywhere in California, but there are railroads, and soon enough they will be carrying Plains All American rail cars.

Once the crude is unloaded in California, it can connect to Plains' existing West Coast pipeline and terminal network, with access to refinery markets in Northern and Southern California.

Foolish takeaway
Plains' deal to acquire these terminals is spot on, and perhaps more importantly, goes into effect by the end of the year. The advantages to shipping by rail are only as good as the economics of the oil markets on any given day. The partnership has proven itself adept at setting realistic expectations and making the most of trends, which is why I'm headed over to CAPS to give it a green thumbs up.