* Crude oil rally lifts energy shares
* Indexes down more than 1 pct for week
* Gap sinks after disappointing March same-store sales
* Dow up 0.2 pct, S&P up 0.3 pct, Nasdaq up 0.1 pct (Updates to close)
By Caroline Valetkevitch
April 8 (Reuters) - A sharp rally in crude oil and energy shares lifted U.S. stocks on Friday, but indexes registered losses for the week and investors were cautious ahead of earnings season.
U.S. crude oil settled more than 6 percent higher after data showed lower U.S. stockpiles, driving gains of 2 percent in the S&P energy index.
Earnings begin in earnest next week with reports from Alcoa and four of the big banks. Analysts are projecting a third straight quarterly decline in earnings at S&P 500 companies.
Investors took their cue again from the oil market and the Federal Reserve, but focus will shift next week to expectedly weak quarterly reports, said Peter Kenny, senior market strategist at Global Markets Advisory Group, in Berkeley Heights, New Jersey.
"The Street is not expecting much in Q1 earnings, but right now the market is moving as a direct result of dovish commentary from the Fed and crude's ability to rally. That is good news for investors but I'm not sure how long of a shelf life that has," he said.
Profits for S&P 500 companies are expected to have declined 7.6 percent in the first quarter, according to Thomson Reuters data. Some strategists expect more results than usual to beat extremely low estimates, possibly helping stocks gain in the short term.
Fed Chair Janet Yellen said late on Thursday that the U.S. economy was on "a solid course," while New York Fed President William Dudley said on Friday a cautious and gradual approach to raising rates was appropriate.
The Dow Jones industrial average was up 35 points, or 0.2 percent, to 17,576.96, the S&P 500 gained 5.69 points, or 0.28 percent, to 2,047.6 and the Nasdaq Composite added 2.32 points, or 0.05 percent, to 4,850.69.
For the week, the Dow and S&P 500 lose 1.2 percent, while the Nasdaq fell 1.3 percent.
S&P 500's weekly loss was its biggest since early February. The index has mostly rallied since mid-February as oil prices rebounded and worries over China eased.
A drop in shares of biotechs and other healthcare companies kept a lid on gains in the Nasdaq and the broader market, with the Nasdaq Biotech index down 1.1 percent on the day.
Valeant Pharmaceuticals fell 5.2 percent to $33.67 after Bill Ackman said that the Canadian drugmaker would not sell Bausch and Lomb.
Gap sank 13.8 percent to $23.85 after the company's disappointing same-store sales for March prompted Citigroup to cut its price target on the stock.
Volume was light. About 6.3 billion shares changed hands on U.S. exchanges, below the 7.1 billion daily average for the past 20 trading days, according to Thomson Reuters data.
Advancing issues outnumbered declining ones on the NYSE by 2,300 to 730, for a 3.15-to-1 ratio on the upside; on the Nasdaq, 1,602 issues rose and 1,205 fell for a 1.33-to-1 ratio favoring advancers.
The S&P 500 posted 18 new 52-week highs and one new low; the Nasdaq recorded 30 new highs and 23 new lows. (Additional reporting by Chuck Mikolajczak in New York; Yashaswini Swamynathan and Abhiram Nandakumar in Bengaluru; Editing by Anil D'Silva and Nick Zieminski)