* TSX up 49.99 pts, or 0.4 pct, at 11,380.67 * Gold miners, energy shares lead gains * Moody's downgrade of Spanish banks weighs By Jon Cook TORONTO, May 18 (Reuters) - Canada's main stock index rose on Friday as gold miners and energy firms continued to rally after a month-long swoon, offsetting jitters about a deepening Spanish banking crisis and uncertainty over Greece's future in the euro zone. Eight of Canada's 10 main sectors were higher. The heavyweight materials group led the charge, up 1.5 percent as miners were boosted by higher gold and copper prices. "Gold stocks are responding nicely to the performance of the gold commodity," said Sid Mokhtari, director of institutional equity research at CIBC World Markets. "Everybody was expecting gold to go lower from these levels, but it has managed to hold very well." Canada's gold mining sub-index has gained nearly 9 percent the last two days. Friday's most influential gainers included Goldcorp Inc, up 3.5 percent at C$36.72, Barrick Gold, up 2.3 percent to C$39.02 and Eldorado Gold , which climbed more than 4 percent to C$11.47. At 10:30 a.m. (1430 GMT), the Toronto Stock Exchange's S&P/TSX composite index was up 49.99 points, or 0.4 percent, at 11,380.67. Energy stocks rose 0.5 percent, as surging U.S. natural gas prices offset a drop in oil, which hit a 2012 low on Friday. Canadian Natural Resources rose 1.3 percent to C$30.14 and Enbridge Inc edged up 0.5 percent at C$40.34. The TSX was still down 2.5 percent for the week and has fallen more than 7 percent in May. Conditions in Europe continued to weigh on financial markets. Investors were spooked by a ratings downgrade of 16 Spanish banks by Moody's Investors Service and fears the sector may need a bailout that would strain Madrid's already stretched finances. "There's a lot of talk about what the downgrades are going to bring from the banking sector in the European community so people are still sitting on the sidelines," said Mokhtari. "Investors are still expecting darker days ahead and that's what's going to keep a cap on the market." The European Commission and the European Central Bank are working on scenarios in case Greece has to leave the euro zone, EU trade commissioner Karel De Gucht said on Friday. Canadian financial shares were flat with investors holding positions ahead of a G8 meeting of leaders of major industrial economies where the euro zone crisis was expected to dominate discussions. Royal Bank of Canada shares rose 1 percent to C$52.49, but was offset by Bank of Nova Scotia, which fell 0.6 percent to C$51.40, and insurer Sun Life Financial , down 0.8 percent to C$21.16. Market watchers in North America were looking ahead to Facebook's Wall Street debut after the world's No.1 online social network raised about $16 billion in one of the biggest initial public offerings in U.S. history.