Some of the best stocks in the oil market over the past year have one thing in common: buybacks. The companies that have spent billions of dollars buying back their shares have dramatically outperformed rivals.

ConocoPhillips (COP 1.35%) is one of these leaders. The U.S. oil giant announced a multi-billion-dollar buyback in late 2016, which has helped catapult its stock 55% higher since then, vastly outperforming the nearly 23% gain from the iShares U.S. Oil & Gas Exploration & Production ETF (IEO 1.13%), which holds more than 60 U.S.-focused oil and gas stocks. Anadarko Petroleum (APC), meanwhile, has rallied almost 60% since unveiling a multi-billion-dollar buyback last fall, doubling the return of the iShares E&P ETF.

Those buyback-driven gains suggest that companies that follow this strategy could replicate this outperformance. While several oil companies are buying back their shares this year, two oil stocks with the greatest potential for a big-time buyback-fueled rally in the coming months are Devon Energy (DVN 1.17%) and QEP Resources (QEP).

Two oil pumps with the sunset in the background.

Image source: Getty Images.

From meaningful to mammoth

This past March, Devon Energy surprised investors by unveiling a plan to send more cash their way. The oil producer boosted its dividend 33% while also authorizing a $1 billion stock-buyback program, which was enough to retire 6% of its outstanding shares at the time. To put that size into perspective, ConocoPhillips bought back 5% of its outstanding stock last year, while Anadarko's initial repurchase program could have retired 10% of its outstanding shares.

Devon's buyback program has already lit a fire under its stock. The oil giant repurchased more than $200 million in shares through the end of April, which has fueled a 35% return for investors since the announcement.

However, shares could have much further to run since they still are flat for the year compared to a roughly 14% gain for the iShares E&P ETF. That's one of the reasons why Devon recently boosted its buyback up to $4 billion after selling its midstream business, which is enough money to retire almost 20% of the company's still-cheap shares. That mammoth buyback could send shares much higher later this year as the company accelerates the pace of its repurchases.

A buyback for the ages

In February, QEP Resources announced a string of strategic initiatives to transform the company into a pure play in the Permian Basin. The company said it would sell all its non-Permian assets and use that cash to repay debt, accelerate the development of its Permian position, and buy back shares as it authorized a $1.25 billion repurchase program. Given where shares traded at the time, that was enough money to retire nearly 50% of its outstanding stock.

While QEP Resources' stock is already up nearly 40% since unveiling its new way forward, shares still could have a lot more upside since they've only risen 18% in the past year -- which is half the return of the iShares E&P ETF. Further, the company has only just begun unlocking the value of its assets.

During the first quarter, QEP sold a couple of small non-core assets for $33.3 million and used those proceeds, along with some of its available credit, to repurchase $58.4 million in stock. The company still has several large asset packages on the market that it intends to sell later this year to give it the cash to take out a more meaningful amount of its shares. As it does, the stock could continue its torrid pace.

An incredible catalyst for investors

Devon Energy and QEP Resources are on pace to retire a significant portion of their outstanding shares over the next year. While the early stages of both buyback programs already have fueled big bounces in their stocks, those gains could be just the beginning given that both companies still have a boatload of shares left to purchase. That buyback-driven upside is why I think QEP's returns could put other stocks to shame and Devon Energy is one of the top stocks to buy right now