* Pan-European FTSEurofirst 300 up 4.2 pct
* Oils and pharmas rise
* U.S. housing market and consumer data downbeat
By Brian Gorman
LONDON, Oct 17 (Reuters) - European shares gained 4.2 percent on Friday, ending a volatile week on a strong note thanks to energy stocks which tracked a recovery in crude, while drugmakers rose ahead of key company reports next week.
The FTSEurofirst 300 index of top European shares <
> ended at 894.77 points, near the day's high of 899.08 points.The index gained 6.3 percent on the week, but has lost 40 percent this year on worries a recession will affect the prospects of companies across the board and add to the effects of banking failures.
Oil groups BP <BP.L>, Total <TOTF.PA> and Royal Dutch Shell <RDSa.L> climbed around 9 percent, having suffered big declines on Thursday. Italy's ENI <ENI.MI> rose 14.5 percent.
The sector tracked a recovery in crude prices, which rose 1.9 percent to more than $71 a barrel, amid growing expectations of an OPEC production cut.
Across Europe, Britain's FTSE 100 <
>, Germany's DAX < > and France's CAC 40 < > posted gains of 3.4 to 5.2 percent.The rise in European shares only clawed back some of the ground lost in the previous two days, when the leading index fell 6.5 percent and 5 percent. But some market participants said there were signs the worst could be over.
"What helps is that we've ended the week in the same way it started, on an upbeat note," said Mike Lenhoff, chief strategist at Brewin Dolphin.
"I somehow felt that although this week was marked by just as much volatility as last week, it had a different feel. There was encouragement from the steps the governments have been taking (to deal with the banking crisis)," Lenhoff said.
Defensive drug stocks also rose. Roche <ROG.VX> and Novartis <NOVN.VX>, which report sales figures and results for the third-quarter next week, gained more than 10 percent, while UK companies AstraZeneca and GlaxoSmithKline <GSK.L> rose 5.2 and 8.6 percent respectively.
U.S. stocks were marginally lower around the time European bourses were closing, after a report showed housing starts slid in September, heightening recession fears.
Construction starts on new U.S. homes fell to a 17-1/2 year low in September as builders scaled back amid a worsening housing slump.
Further, the Reuters/University of Michigan Surveys of Consumers showed confidence plummeting in October, with the preliminary consumer sentiment index falling to 57.5 from September's final reading of 70.3. Economists in a Reuters survey had expected a preliminary October reading of 65.5.
The Dow Jones Industrials <
>, S&P 500 <.SPX> and Nasdaq Composite < > indexes were down between 0.5 and 0.9 percent.
ING TUMBLES
Europe's banking sector was mixed. Dutch financial services group ING <ING.AS> slumped 27 percent, following a report in Dutch business daily Het Financieele Dagblad citing analysts saying the company was under increasing pressure to strengthen its capital. The company declined to comment.
France's BNP Paribas <BNPP.PA> reversed earlier losses to close up 1.7 percent.
Insurers were mostly lower, notably Aviva <AV.L> and Prudential <PRU.L> in the UK, off 12.7 and 9.3 percent respectively.
Handset makers Ericsson <ERICb.ST> and Nokia <NOK1V.HE> were strong, rising 5 and 10.6 percent respectively. Nokia had posted a fall in third-quarter earnings on Thursday but sounded a reassuring note about cellphone volumes for the full year.
Shares in auto group Daimler <DAIGn.DE> jumped 9.2 percent after a source familiar with the talks said private equity group Cerberus was in talks to buy Daimler's remaining stake in Chrysler. Daimler declined to comment.
Miners rose, including Anglo American <AAL.L>, up 12.3 percent, and Rio Tinto, up 9.8 percent, amid a mixed picture for metals prices.
Brewin Dolphin's Lenhoff said the market overall was subject to two-way pull.
"We've fallen so far, the market is prepared for disappointment. It's caught between the encouraging steps forward by governments and the fact that there's a recession out there, and that will limit the upside." (Additional reporting by Tyler Sitte; Editing by David Holmes)