Shares of Plains All American Pipeline (NYSE: PAA) hit a 52-week high on Wednesday. Let's take a look at how it got there and see if clear skies are still in the forecast.

How it got here
As my Foolishly energetic colleague Aimee Duffy has expounded on numerous occasions, midstream assets, which include pipelines and storage facilities, are at the center of the energy industry's investments. With an estimated $130 billion to $210 billion waiting to be invested over the next 20 years, companies like Plains All American are taking advantage of their necessary role as intermediaries between explorers and refiners.

The allure of an MLP like Plains All American is that as energy demand grows and more natural gas discoveries are made, the need for transportation and storage of this clean energy will only increase. The company owns pipelines throughout the U.S. and Canada and, through majority ownership in PAA Natural Gas Storage (NYSE: PNG), generates income from storing natural gas. Providing a necessity service has its perks which include relatively consistent cash flow (even in light of decade-low natural gas prices), and a delectable dividend which is currently close to 5% and has been raised in 31 of the past 33 quarters.

However, even necessity stocks have concerns. In June, we were unfortunately privy to not one, but two oil spills -- both in Canada. Enbridge (NYSE: ENB) suffered a spill at its Elk Point pumping station while Plains All American, slightly earlier in the month, announced a spill of 28,000 barrels of oil from its Rainbow pipeline. The legal implications of these spills, the cost of pipeline maintenance, and global economic weakness are all potential concerns.

How it stacks up
Let's see how Plains All American compares to its peers.

PAA Chart

PAA data by YCharts

For the most part, Plains All American, Enterprise Products Partners (NYSE: EPD), and Kinder Morgan Energy Partners (NYSE: KMP) have all traded very close to one another. Let's take a closer look at their underlying metrics to attempt to differentiate them further.

Company

Price/Book

Price/Cash Flow

Forward P/E

Dividend Yield

Plains All American 2.3 6.5 15.3 4.7%
Enterprise Products Partners 4.0 15.2 20.2 4.5%
Kinder Morgan Energy Partners 2.8 9.4 27.3 5.5%

Source: Morningstar.

Unfortunately, I didn't get nearly the differentiation I was hoping for. Plains All American trades at the biggest discount relative to the metrics above, but is also dealing with spill cleanup efforts and possible legal implications.

Kinder Morgan Energy Partners, as Aimee Duffy reported last week, has a lot of promise and the highest yield of this group, but it's also struggling mightily to get the expansion of its Trans Mountain pipeline approved in Canada. Currently lacking community and environmental support, Kinder Morgan has the plan, but not the governmental OK, to enact what could be a huge boost to its bottom line if approved.

Enterprise Products may offer what appears to be the weakest dividend yield here (although 4.5% isn't really weak), however, it also holds a 32-quarter streak of dividend increases. As one of the largest pipeline operators its geographic diversity is a welcome sight for most income-seeking investors.

What's next
Now for the $64,000 question: What's next for Plains All American? The answer depends on Plains' ability to keep up on maintaining its pipelines so as to avoid spills like we witnessed in June, its ability to continue to boost its dividend, and whether it can continue to expand its pipeline and storage network.

Our very own CAPS community gives the company a highly coveted five-star rating, with an overwhelming 97.9% of members expecting it to outperform. Despite one of the highest bull-to-bear ratios on CAPS, 324-7, I have yet to, and won't be making, a CAPScall on Plains All American today.

Simply put, I do believe in the long-term story of this company. What concerns me about its current valuation are both the possible legal implications of its recent spill, and the cash rotation that could occur as natural gas prices rise and investors take their money out of risk-averse assets like pipelines and put it back to work into riskier natural gas drillers. Overall, I don't see how you'll go wrong with Plains All American over the very long term, but I think I can do better with my entry point that right here. Let's add it to the Watchlist and review it again in a couple of months.

Even if Plains All American isn't the income-producing stock for you, you'll find plenty of other great ideas from our team at Stock Advisor. Find out for free which nine other dividend-paying stocks could lead you to a comfortable retirement. Simply click here for access to our latest special report.

Craving more input on Plains All American? Start by adding it to your free and personalized watchlist. It's a free service from The Motley Fool to keep you up to date on the stocks you care about most.