TORONTO — The Toronto stock market closed lower Friday and commodities lost ground amid growing worries about the European debt crisis.The S&P/TSX composite index declined 42.79 points to 11,622.91 as Spain again dealt with higher borrowing costs while the TSX Venture Exchange was up 5.32 points to 1,196.19.The Canadian dollar lost 0.48 of a US cent to 98.75 US cents after the loonie closed at a two-month high on Thursday.Traders also took in data showing Canada’s annual inflation rate rose 0.3 of a percentage point to 1.5% in June. That’s up from 1.2% the previous month. On a month-to-month basis, the consumer price index fell 0.4% from May.The increase in the annual rate was mostly attributed to effects from the same period a year earlier, when gas prices were receding and the cost of new automobiles fell by over 3%.U.S. markets were lower amid a mixed bag of corporate earnings from heavyweights including Microsoft Corp., General Electric and Xerox.The Dow Jones industrials tumbled 120.79 points to 12,822.57.The Nasdaq composite index dropped 40.6 points to 2,925.3 and the S&P 500 index declined 13.85 points to 1,362.66.The risk-on sentiment grew as the yield on Spain’s benchmark 10-year bond ran up to 7.05% on Friday, from 6.98% the previous day. A rate of 7% and above is considered unsustainable.Yields rose even as finance ministers from the 17 euro countries approved a bailout for Spanish banks.But investors fear that the Spanish government could in the meantime face new costs helping its banks and could eventually need rescue loans itself.Also, Spain’s major stock index tumbled 6% after the country predicted its recession will drag into 2013.The TSX racked up an overall gain for the week of 0.94% on rising expectations that central banks will step up to ensure the economic recovery stays on the rails.Markets have also found support from a better-than-expected second quarter earnings season.“Going into this quarter, the sentiment had been very guarded to put it mildly,” said Robert Gorman, chief portfolio strategist TD Waterhouse.“People thought, given the slower rate of growth and the U.S. recovery, we might have a higher proportion of firms missing estimates. But for the most part, they have been beating bottom line expectations, not by much, but meaningfully, though in many cases the revenue numbers have been coming up shy, reflecting slower growth.”On Friday, General Electric reported that its quarterly net income fell 16% to US$3.11 or 29 cents a share because of losses in businesses it has divested and an increase in pension costs. Excluding pension costs and losses from discontinued businesses, GE earned 38 cents, a penny better than analysts were expecting. It also reaffirmed its outlook.GE is viewed as an important economic bellwether since its businesses range from appliances to financial services to wind and gas turbines. Its stock shook off early losses and gained 6.5 cents to US$19.865.Microsoft said Thursday that an accounting adjustment to reflect a weak online ad business led to its first quarterly loss in its 26 years as a public company. Microsoft racked up a US$492-million loss in the April-June quarter while revenue rose 4% to US$18.06 billion. Ex-items, the company earned 73 cents a share, a dime better than forecasts and its shares slipped 55 cents to US$30.115.Xerox Corp. cut its full-year profit forecast as the provider of printers and business services said that second-quarter net income fell 3.1% to US$309-million or 22 cents a share, missing forecasts by four cents. Revenue dropped 1.3% to $5.54-billion, against expectations of $5.61-billion. Xerox added that third quarter profits will also miss estimates. Xerox shares dropped 48.5 cents to US$6.705.On the TSX, shares in West Fraser Timber Co. Ltd. gained $2.57 to $53.50 after the lumber producer said second-quarter earnings after discontinued operations were $27-million, or 63 cents per share. That was up from $10-million or 24 cents per share in the same quarter of 2011. Revenues rose to $774-million from $720-million in the year-earlier period.The TSX energy sector was off 0.47% as oil prices slipped after rising Mideast tensions sent crude up by almost $3 on Thursday.The August crude contract on the New York Mercantile Exchange fell $1.22 to US$91.44 a barrel. Cenovus Energy was down 40 cents to $32.54.Crude rose about 5% over the last week as the oil market responded to a series of events that have raised concerns that Iran will try to block oil shipments through the Strait of Hormuz, a narrow waterway in the Persian Gulf through which one-fifth of the world’s oil travels every day.The base metals sector gave back almost two% with metals also lower with copper down nine cents to US$3.45 a pound. First Quantum Minerals shed 33 cents to $17.95.The tech sector was off 1.53% while CGI Group shed 50 cents to $23.83 while Research In Motion Ltd. gave back 16 cents to $6.87.Financials were also a major source of weakness with Manulife Financial down 19 cents to $10.67.TSX losses were limited by a gain of about 0.5% in the gold sector as bullion climbed $2.40 to US$1,582.80 an ounce. Goldcorp Inc. climbed 44 cents to $34.04.In other corporate developments, Calgary-based Enbridge Inc. says it’s ready to improve the design of the Northern Gateway pipeline to address concerns raised by Aboriginal groups and others.The company says the changes for the proposed pipeline through British Columbia would use the most advanced technology and safety measures. Its shares slipped 17 cents to $41.08.