The best time to buy a stock is often when no one else wants to. Energy stocks fall into that unloved category right now -- oil prices are getting hit by a supply/demand imbalance, the push for ESG investing, and concerns about a global slowdown tied to the coronavirus. If you can stomach going against the grain, you might want to take a closer look at the pros and cons of oil. And then we can drill into three of the biggest oil companies on planet Earth, each of which looks attractive today. Why oil is still an interesting investment There's a host of reasons why you might not want to buy oil stocks today, but what about reasons to buy them? For example, oil and natural gas prices are low because of a supply/demand imbalance. These are commodities, so this situation isn't actually uncommon. Over time, low prices usually push weaker players out of the energy market and lead larger players to pull back on supply. That should, eventually, even out supply and demand. Image source: Getty Images The carbon issue is a big one, with ESG investors pushing hard for large financial players to divest energy stocks. That's fine, but the bigger-picture truth is that oil and natural gas are vital parts of the global energy picture, and will remain so for years to come. Eventually these fuels will be displaced, but the infrastructure needed to do that will require time to build. Oil and the companies that produce it aren't going away any time soon. As for the coronavirus, that's a wildcard that's hard to predict. It is a potential Black Swan event for the global economy and stock markets around the world. That said, history suggests that it will eventually pass. And if it doesn't, there will be much bigger issues to worry about than what stocks to buy... Two oil giants shifting with the times The first two oil stocks to look at today are Royal Dutch Shell (NYSE: RDS.B) and Total (NYSE: TOT). They offer yields of 7% and 5.8%, respectively. There's a bit of a difference in the dividends, however: Shell's dividend has been static since the deep 2014 oil bear market, while Total held the dividend steady in 2014 and 2015, but started to increase it annually again in 2016. So for investors looking for dividend growth, Total has the edge here. Those focused on maximizing current income, meanwhile, might prefer Shell. That said, these two both have diversified energy businesses. That includes assets that range from the upstream (drilling) to downstream (chemicals and refining) segments. That helps to provide some balance to their operations over the long term, even though right now the entire industry is suffering. Their balance sheets, meanwhile, are leveraged, but not so much that investors should worry about their long-term viability. Shell's financial debt to equity ratio is around 0.4 times, and Total's is roughly 0.45 times. Both cover their interest expenses by solid margins, with Shell at 6 times and Total at 8 times. They appear more than strong enough to muddle through this downturn, like they have done through many downturns before. TOT Financial Debt to Equity (Quarterly) data by YCharts Both are still investing in their core operations, of course. But what should get investors really excited is that these two oil and gas giants are also starting to look toward the electric future. In fact, just a couple of years ago Total bought an electric utility for $1.6 billion, staying close to its core operating area while giving it a sizable toehold in a business that is expected to displace oil in the future. Shell hasn't been quite as aggressive, but it has been spending a little here and a little there as it builds a collection of electric assets. That spending adds up, however, with the company looking to spend between $2 billion and $3 billion a year through 2025 in this space on things like electric vehicle charging stations and renewable power projects. The end goal of each, meanwhile, is to use the businesses they have today as cash cows to build for the future. If that sounds like a good goal, then you need to do a deep dive on this pair right now -- even though Wall Street is down on almost anything related to oil today. One giant doubling down on oil Another option in times like these is to simply double down. That's what ExxonMobil (NYSE: XOM) is doing. Although it is working on carbon capture technology and trying to use algae to produce a clean oil alternative, it intends to spend up to $35 billion a year through 2025 to expand its oil production. In short, if you buy Exxon you are betting that oil and natural gas will remain key fuels globally, and that their prices will eventually rebound. In return, you can collect a 5.6% dividend yield (which is historically high for the stock) that's backed by a dividend that has been increased annually for over 35 years. One of the key factors that differentiates Exxon is its financial strength. Its financial debt to equity ratio is less than 0.2 times, half of Shell's ratio. Exxon, meanwhile, covers its interest expenses by around 20 times, well more than the two names above. It has the financial strength to keep spending even in the face of adversity. Add in a diversified energy business like those of its peers, and there's no reason to expect that Exxon can't muddle through to better days. XOM Financial Debt to Equity (Quarterly) data by YCharts More important here is that its heavy spending is producing the desired results. And the upturn in production that was seen in 2019 was really driven by just one major project -- onshore U.S. drilling. A second big project started producing oil in December of 2019, and should ramp up throughout 2020 (with more to come in future years). There are other projects in the works, too. It appears that Exxon is on the verge of a production growth spurt. And, equally important, as Exxon's spending leads to increased production, the company's return on capital employed (ROCE) should improve as well. That's been another sore spot for investors, which have been frustrated by relatively weak ROCE results, which suggest Exxon isn't using its shareholders' cash as well as peers. To be fair, Exxon is the more contrarian play here. If you can think long-term, however, Exxon appears to have the financial strength to see its plan through. The big question is whether this time is different in the energy sector. If it is and oil is dead, then Exxon is making a very bad bet. If, however, oil eventually bounces back from adversity (like it has so many times before), then Exxon could turn into a very desirable investment. These oil giants are worth a second look There's no way to tell what the coronavirus will do to the global economy, and there's no way to tell exactly when electrification will fully displace oil. But if you can look past the Wall Street hype, you might just find that there's still a lot of opportunity for energy stocks like Shell, Total, and Exxon. The first two are hedging their bets and looking to participate in the transition to electricity. Exxon is doubling down on what it knows best. If you like dividends, all three are worth close looks. You might find that one or two have places in your portfolio today. 10 stocks we like better than ExxonMobilWhen investing geniuses David and Tom Gardner have a stock tip, it can pay to listen. After all, the newsletter they have run for over a decade, Motley Fool Stock Advisor, has tripled the market.* David and Tom just revealed what they believe are the ten best stocks for investors to buy right now... and ExxonMobil wasn't one of them! That's right -- they think these 10 stocks are even better buys. See the 10 stocks *Stock Advisor returns as of December 1, 2019 Reuben Gregg Brewer owns shares of ExxonMobil. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.Source