Oil prices have surged this year as the conflict in the Middle East has disrupted global energy supplies.
And the impact is being felt across the economy, from higher petrol prices and airfares to rising food and transport costs.
But some of the biggest winners from elevated oil prices could be the energy producers themselves. So, would I buy Santos Ltd (ASX: STO) or Woodside Energy Group Ltd (ASX: WDS) shares to take advantage?
Here's what I think.

Image source: Getty Images
Woodside shares
Woodside is one of Australia's largest energy producers, with a portfolio of oil and gas operations spanning several countries.
What I like about Woodside is the amount of new production it has coming online over the next few years.
Its Scarborough gas project was 99% complete at the end of September, with the company expecting its first LNG cargo before the end of 2026.
Meanwhile, its Trion oil development in Mexico remains on track for first production in 2028. These projects should provide Woodside with additional volumes to sell, which could be extremely valuable if energy prices remain elevated.
There is also the Louisiana LNG project, which is targeting first production in 2029 and could support growth well into the next decade.
Of course, developing major energy projects requires substantial capital, and delays or cost overruns could weigh on returns. But I like the opportunity for Woodside to benefit from both higher prices and growing production. And at $33.23, I also think the shares look reasonably valued.
Santos shares
Santos is another major Australian energy producer, but its investment story is at a slightly different stage.
The company has recently brought two important projects into production. Its Barossa gas project is now supplying Darwin LNG, while the Pikka oil project in Alaska has started contributing to production.
And we're already seeing the impact. In the September quarter, Santos reported record production of 26.3 million barrels of oil equivalent, an increase of 23% year on year.
That helped the company generate record quarterly cash flow from operations of approximately US$1.07 billion.
I think this puts Santos in an excellent position to benefit if oil prices remain high. With the major construction spending behind these projects, there is an opportunity for increased production to translate into stronger cash flow and shareholder returns.
Pikka has experienced some operational interruptions during its ramp-up, so there is still work to do. But I like that Santos is beginning to realise the benefits of investments it has been making for years.
Which is better value?
This is where the comparison gets interesting. Based on consensus forecasts, Woodside shares look slightly cheaper on FY26 earnings.
At $33.23, its shares trade on a PE ratio of approximately 12 times expected earnings, compared with 13.5 times for Santos.
But looking further ahead changes the picture. Both shares trade on around 9.6 times forecast FY27 earnings.
By FY28, however, Santos looks better value, trading on approximately 11.3 times expected earnings compared with 12.4 times for Woodside shares.
What about dividends? Well, Santos is forecast to pay 70.2 cents per share in FY28, representing a dividend yield of 7.6%. Woodside's forecast FY28 dividend of $2.21 per share represents a yield of approximately 6.7%.
Of course, these forecasts are sensitive to commodity prices, which can change considerably over time.
And both companies have substantial exposure to LNG, meaning their earnings won't necessarily move directly in line with oil prices.
Foolish takeaway
I think both Woodside and Santos shares are worth buying if you're optimistic about energy prices.
Woodside has a substantial pipeline of developments that could support growth over the coming years.
But if I were choosing just one today, I would probably lean towards Santos. Its recent production growth, improving cash generation, and more attractive FY28 valuation give it the edge for me.