*TSX gets big boost from energy, materials issues
*Energy shares rise as oil rebounds to $138
*Gold miners benefit as Mideast tensions buoy metal prices
TORONTO, July 9 (Reuters) - The Toronto Stock Exchange's main index was sharply higher at midmorning on Wednesday, extending the previous session's gains and boosted by strength in its key energy sector as oil prices rose.
The oil and gas group was up 2.2 percent as oil prices, which had fallen from record highs earlier this week, rebounded to around $138 barrel as political tension rose amid reports Iran had test-fired missiles.
"The crude prices went up again this morning on the geopolitical situation that is developing in the Middle East," said Joe Ismail, technical analyst at Maison Placements Canada.
"I wouldn't be surprised to see investors coming in and picking up the oil and gas stocks."
The S&P/TSX composite index .GSPTSE was up 158.06 points, or 1.1 percent, at 13,967.83. Of its 10 main groups, six were higher, with energy issues leading the rise.
The resources-laden materials sector also provided a boost, up 2.2 percent, as gold climbed on safe-haven buying as a result of the tension in the Middle East.
The morning rally on Wednesday pulled the benchmark further away from official correction territory, but it remained down around 7.8 percent from the record high it reached in early June.
Wednesday's rise is part of a "normal corrective phase," Ismail said.
Corus Entertainment Inc (CJRb.TO) rose 32 Canadian cents, or 1.9 percent, to C$17.12 after the Canadian radio and specialty-TV group reported a 27 percent jump in its third-quarter profit before the bell on Wednesday.
MDS Inc MDS.TO fell 18 Canadian cents, or 1.1 percent, to C$15.65. The company said on Wednesday it has filed a C$1.6 billion court claim against Atomic Energy of Canada Ltd and the government of Canada for breach of contract related to a nuclear reactor project. ($1=$1.01 Canadian) (Reporting by Jennifer Kwan; Editing by Peter Galloway)