Canadian oil sands producers such as Cenovus and MEG Energy impressed investors in the second quarter as prices of heavy crude rose, but those gains are expected to be short-lived.

Most of these companies are expected to book losses or post sharp drops in profit in the coming quarters as prices take a hit from a spike in oil sands production and costs rise due to a lack of pipeline capacity.

Demand for heavy crude extracted from Canadian oil sands surged in the past few months as U.S. refiners sought alternatives amid supply disruptions in key exporter Venezuela and restricted exports by the OPEC.

As a result, prices of Canadian heavy crude have shot up, prompting companies to crank up production. Cenovus's total production jumped 65 percent in the quarter ended June 30, while MEG Energy's hit the upper end of its forecast..

Western Canadian Select (WCS) - the benchmark for heavy crude - is trading at a discount of only $9.90 to West Texas Intermediate (WTI). Historically, the difference has been around $15.

However, a string of new projects coming online this year, including Suncor Energy's Fort Hills project and Canadian Natural Resources' Horizon Phase 3, could lead to a glut and put pressure on prices.

"Just those two projects are going to (add) over 200,000 barrels (per day)," said Stephen Kallir, a Canadian energy analyst with research firm Wood Mackenzie. Kallir said he expects the WTI-WCS spread to return to historical levels in 2018.

Halting projects to cope with low oil prices is not a viable option for Canadian companies as mining for oil sands involves large upfront investments and long lead times.

Much of the benefits these companies are seeing now is tied to the success of OPEC's efforts to reduce production. If OPEC members go back to historic production levels, prices of Canadian heavy crude will fall.

"As long as there is OPEC action targeting reducing heavy and medium sour crude to the Gulf Coast, that would be supportive of the price differential, but we have no control of what the OPEC does," said Mark Sadeghian, a senior director at Fitch Ratings.

The other problem Canadian heavy oil producers are grappling with is the lack of options to efficiently transport the commodity to meet increased demand.

Current pipelines are expected to hit full capacity in the next couple of years, meaning companies will have to resort to more expensive options such as rail to move oil.

The expansion of pipelines such as Kinder Morgan's Trans Mountain and TransCanada's Keystone XL could alleviate some of the transport pressures, but those projects have run into multiple hurdles with environmental groups and local communities, making it difficult to predict when they will come into effect.

"Until we see things like Trans Mountain go ahead, there is really not a lot these producers can do to try and mitigate those structural headwinds," Raymond James analyst Christopher Cox said.