Alberta called it the "bitumen bubble," and warned earlier this year that low prices for its heavy oil would bleed billions from corporate and government bottom lines.

But only months later, bitumen is back, as trains help to clear export clogs and pipeline construction opens new avenues for crude to move to market. The changes have been reflected in a more favourable Canadian heavy oil price, which now stands at about $20 (U.S.) a barrel less than West Texas intermediate, compared with a $40-a-barrel discount late last year.

Now, the shift is spreading into investor and corporate sentiment, as hope spreads that the worst is over and more profitable days are ahead for a sector that faced a difficult winter. A smoother flow of exported oil is adding to optimism that the sector can refocus on production growth targets.

Story continues below advertisement

Since mid-April, when it hit its lowest point in 2013, the S&P/TSX energy index has risen 8.5 per cent, although in the past year its growth is still only half that of the main index. The energy index is highly sensitive to bitumen prices because many of its biggest constituents are companies with large oil sands operations.

"I think we've essentially reached the point where we've tipped over to the other side," said Martin King, vice-president of institutional research with Calgary's FirstEnergy Capital Corp. "The capacity to move crude out of Canada has exceeded the rate at which supply is being added."

Trains are a key part of the calculation. Estimates vary widely, but about 100,000 barrels a day of Canadian oil are now moving to market by rail. Construction of a series of new rail loading terminals promises to boost that capacity dramatically.

Such capacity could rise to 250,000 b/d by early next year, and 300,000 the following year, according to calculations done by Chris Theal, a former financial analyst who is now chief executive officer of Kootenay Capital Management Corp.

Mr. Theal is betting that the summer will produce "big earnings and cash flow momentum" for heavy oil companies. Markets have reached a point of "maximum pessimism today on heavy oil," he said, but "the worse it gets, the more rapidly industry is going to take steps to fix it – and the more upside there is."

At the same time, Enbridge Inc. and TransCanada Corp. are scrambling to open several new pipelines – all of which should be open within a year – that will carry hundreds of thousands of barrels a day of Canadian oil to the Gulf Coast.

"We're well on our way to having the problem getting resolved and getting into a more normal range of trading," said James Bowzer, CEO of Baytex Energy Corp.

Story continues below advertisement

That hope flies in the face of deep concerns about Canadian crude: the high cost of producing new oil sands barrels, the tight profit margins that result and, as of last November, full export pipelines, which precipitated a fall in prices. Amid the unease, a number of planned oil sands deals have fallen through recently.

Reasons for worry remain. Imperial Oil Ltd.'s Kearl oil sands mine is pumping out increasing volumes of oil alongside growth at Suncor Energy Inc. and Cenovus Energy Inc.

BP PLC's 337,000 b/d Whiting refinery, which is in the midst of a multibillion-dollar conversion to process mostly heavy oil, has experienced delays in reopening. It's possible it won't begin accepting large volumes of oil until December, said Randy Ollenberger, managing director at BMO Nesbitt Burns.

If new production comes on fast, and refining capacity lags, "you could have a market that is significantly oversupplied by the end of the third quarter, heading into the fourth quarter," he said. That could again swell the Canadian heavy oil discount to $30 a barrel, he said.

But if 2013 is uncertain, Mr. Ollenberger believes 2014 will be better. A positive decision on the Keystone XL pipeline, for example, could pop share values by as much as 5 to 10 per cent, he said. The heavy oil discount could shrink into the teens.

"What you're seeing right now is a reluctance by the market to pay for oil sands growth. So the valuations of companies reflect more the value of existing assets," he said. "If Keystone is approved, it allows the market to start factoring in some of the growth potential."

Story continues below advertisement

A positive Keystone decision remains far from assured, however, and the Alberta government – which paid for a province-wide January TV slot to warn Albertans about the "bitumen bubble" – is not backing away from its pessimism. After December heavy oil prices averaged $57 per barrel, Premier Alison Redford predicted a $6-billion budget hole. On Tuesday, Canadian heavy futures traded at over $75. But Alberta is sticking by its forecast of $68.21.

"We're not expecting a substantial improvement in 2013-14," said Mike Feenstra, a spokesman for Alberta Energy Minister Ken Hughes. He added: "Right now, Albertans are not receiving fair value for their resources and that is what motivates us to continue to push for greater access to markets and to reach tidewater."