Upstream, midstream, and downstream aren't just spots in a freshwater ecosystem. They're also the three important sectors of the oil and gas industry. Upstream exploration and production companies, like ConocoPhillips (COP -0.72%), drill the oil and gas, then send it through the "midstream" pipelines and storage tanks to a downstream refiner and seller, like Sunoco LP (SUN -2.94%)

Today, let's pit ConocoPhillips and Sunoco LP against each other to see which one looks like the better buy.

A man's hand holds a nozzle at a gas pump.

Conoco and Sunoco are both oil industry players that have been hammered by the stock market. Image source: Getty Images.

Balance sheet

Our first stop is the companies' balance sheets, and the first thing to notice is that both companies have had to go into heavy debt to maintain their operations. Conoco already had a sizable debt load prior to the oil price slump in 2014, but like most of its peers, it's had to incur additional debt to cover its operations since. That pushed the company's long-term debt load to an eye-popping $27.3 billion, although Conoco has paid down quite a bit of that in the past year, and now has "just" $19.7 billion in long-term debt on its balance sheet.

Sunoco, likewise, has seen its debt load balloon since 2014, but it has largely used the debt to finance acquisitions, including some from its former parent, Energy Transfer Partners (ETP), and it ran up long-term debts of $4.4 billion. After some asset sales and an infusion of liquidity from another Energy Transfer company, Energy Transfer Equity, the company's total long-term debt load stands at $3.5 billion.  

That may sound like Conoco is in worse shape, but you have to factor in that it's nearly 18 times larger than Sunoco by market cap. In fact, Sunoco's debt-to-equity ratio is a massive 1.2, compared to Conoco's 0.4 (smaller is better). Sunoco boasted in its most recent Q3 earnings release that it had gotten its leverage ratio down to 5.6 times, when a generally accepted upper limit for a master limited partnership is four times. 

No contest here: Conoco's balance sheet is the winner.

Winner: ConocoPhillips

Dividend yield

Any energy investor is going to be interested in a company's yield, and at first glance, there appears to be no contest here. Sunoco currently yields a mouth-watering 11.2%, absolutely crushing Conoco's 2.1% yield. That's due in part to Conoco's slashing its yield by nearly two-thirds in response to the oil price slump.

Ordinarily, this would be no contest at all, but the problem with looking exclusively at a company's yield is that yields can change, particularly if it's not able to cover its generous dividend payout with cash. And for much of the past year, Sunoco's dividend payouts came dangerously close to exceeding its cash flow, with an average coverage ratio of just 1.03 for the four quarters between Q3 2016 and Q2 2017. 

In the most recent quarter, Sunoco reported a much-improved coverage ratio of 1.28, thanks in part to better wholesale fuel prices. But if those prices slip again, Sunoco could be stuck making tough choices between upping its debt (again) or cutting its dividend. Still, for now, the dividend seems safe, and even if it were cut in half, it would be more than twice Conoco's, so I'm giving Sunoco the win in this category for now.

Winner: Sunoco LP

The path forward

Looking at a company's balance sheet and its current dividend can provide a good idea of where the company is today. But investors also need to be concerned with where the company will be headed in the future. 

ConocoPhillips has outlined a clear strategy, which it is already executing by selling low-margin North American assets to pull down its average cost of supply. This not only generates cash from the asset sales, but helps the company improve its cash flow. Management plans to use this extra cash to pay down another $5 billion in debt, buy back an average of $1.5 billion of stock in each of the next three years, and have enough left over to continue to invest in the company's growth.

For Sunoco, the future is quite a bit murkier, and involves big changes to its operations. Besides its big spate of recent acquisitions, the company entered a $3.3 billion deal to sell most of its convenience stores to 7-Eleven. This would not only help Sunoco pay down its debt quickly, but would also benefit from a long-term fuel supply agreement to help offset some of that lost convenience store revenue. Alas, in October, this plan hit a snag when some of Sunoco's bondholders raised objections.

Even if the deal goes through, there's no denying that Conoco is looking at a much more solid future than Sunoco.

Winner: ConocoPhillips

And the winner is...

Despite its massive current yield, Sunoco LP is a company with a lot of problems, and there's no guarantee that the solutions it's proposing will be enough to clean up the company's balance sheet and help it to grow. ConocoPhillips, on the other hand, appears to be finally emerging from the woods. No question, ConocoPhillips is the better buy.