After a tumultuous trading day, U.S. stocks closed Friday having barely changed from the morning open after a jury's verdict against Merck & Co. (MRK), a Dow component, sent the drugmaker's shares down 7.7 percent. That company's plunge offset gains in blue-chips like International Business Machines Corp. (IBM) and Caterpillar Inc. (CAT)

Much of the market's earlier advance Friday, fueled by bargain hunting, was erased.

A Texas jury ruled that Merck was negligent in the death of a man who took its painkiller Vioxx and ordered the company to pay over a quarter-billion dollars in damages. Merck said it planned to appeal the verdict.

"The Merck verdict is obviously negative for the Dow. But is it going to take the averages way down today? I don't think so," said Peter Cardillo, chief market analyst and chief strategist at SW Bach & Co.

While the Dow Jones industrial average and the Standard & Poor's 500 index ended the day slightly higher, the Nasdaq dipped, weighed by shares of tech companies, including Apple Computer Inc. (AAPL) and Intel Corp. (INTC)

The Dow gained 4.30 points to close at 10,559.23, while the broad S&P 500 inched up just 0.69 of a point to finish at 1,219.71. The technology-laced Nasdaq dropped 0.52 of a point to close at 2,135.56.

For the week, the Dow ended down 0.39 percent, while the Nasdaq fell 0.99 percent and the S&P 500 slid 0.87 percent.

"We're just bouncing off an oversold condition. We've been selling off here for almost two weeks now since we peaked," said Paul D. Mendelsohn, chief investment strategist at Windham Financial Services, of Charlotte, Vermont. "Bargain hunters came in here and bought stocks down at these levels."

The overall market managed a small gain as bargain hunters continued to take advantage of recent declines and bought up underperforming stocks. Positive analyst reports on Coca-Cola Inc. (KO) and International Business Machines Corp., as well as indications of continued growth in China from Caterpillar Inc., encouraged investors.

Delphi (DPH) shares also rose after Lehman Brothers raised its rating on the largest U.S. auto parts supplier to "overweight" from "underweight."

On Nasdaq, shares of software maker Autodesk, Inc. (ADSK) rose a day after the company said its quarterly net profit nearly doubled. It was up 5.3 percent at $40.38.

IBM rose $1.61 to $82.76 on the New York Stock Exchange (search) after a Prudential analyst reiterated his "overweight" rating.

Shares of heavy-equipment maker Caterpillar rose $1.67 to $54.82 on the NYSE after the company said it was stepping up its presence in China.

The markets' upswing also held despite a jump in crude oil futures, which rose on news of demonstrations in Ecuador that have disrupted oil exports.

Oil prices jumped after rocket attacks in the Middle East and protests in Ecuador raised concerns about supply disruptions. U.S. crude for September delivery rose by $2.08 to settle at $65.35 a barrel on the New York Mercantile Exchange.

Shares of Exxon Mobil Corp. (XOM) gained 71 cents to $58.82. ConocoPhillips (COP) rose $1.47 to $63.07. Both trade on the NYSE.

Merrill Lynch & Co. raised its forecasts for long-term U.S. light crude prices by 40 percent to $42 a barrel. Goldman Sachs & Co. on Thursday also raised its oil price forecast for the rest of the year to $67 a barrel, saying reinvestment rates by the oil industry are declining.

Strategists described Friday as a pause after several days in which the markets headed lower. They also attributed some of the rise to the monthly expiration of some options contracts.

Friday was the last trading day for August individual equity options, which expire Saturday. The unwinding of those positions added some volatility to the market and helped boost shares, traders said.

"Options expire today and a lot of things had been marked up pre-opening," said Stephen Carl, principal and head of U.S. equity trading at The Williams Capital Group LP, of New York. He noted the S&P 500 and Nasdaq were bouncing back after sharp declines in previous days and remained down for the week.

"We got hammered at the beginning of the week," he said.

Shares of Merck slid 7.7 percent, or $2.35, to $28.06 on the NYSE after the Texas verdict in the Vioxx case.

The stock of its rival Pfizer dropped 33 cents, to $25.55 on the NYSE, while the American Stock Exchange's Pharmaceutical Index (search) was down 0.8 percent.

"It's important to the pharmaceutical sector. It brings up the specter of liability that is out there," said Barry Hyman, equity market strategist at Ehrenkrantz, King and Nussbaum of New York, in reference to the Merck verdict.

Shares of Apple, maker of Macintosh and iPod products, closed down 47 cents at $45.83. That gravity helped pull the Nasdaq down. Intel, the world's dominant chipmaker and a Dow component 23 cents to $25.65 in Nasdaq trading.

Retail shares also fell after apparel chain Gap Inc. (GPS) slashed its forecast for 2005 due to weaker sales. Gap shares slid 41 cents to $19.74 on the NYSE.

The company's lowered profit estimates, along with troubles from companies like Bebe (BEBE) and Limited (LTD), weighed on the retail sector bolstering concerns that rising gasoline prices could lead to a potential slowdown in consumer spending.

Shares of the teen apparel retailer Bebe Stores Inc. fell .10 to close at $24.62 after the company offered a profit forecast for the current quarter that was at the low end of market expectations.

Limited Brands Inc. had said Thursday profits for its second quarter fell 24 percent, and it warned that disappointing performances among its clothing lines would help drive earnings below Wall Street expectations for the third quarter and for the year. But shares of the company actually ended up .04 to close at $22.15.

But Ann Taylor Stores Corp. (ANN) jumped, ending at $26.60, up 1.56 even after the clothing retailer's second-quarter profits fell due to softer sales. The company nonetheless exceeded Wall Street's expectations by a penny per share, and said improved margins would help it meet previously stated full-year profit targets.

Trading was moderate, with 1.22 billion shares changing hands on the Big Board, below the 1.46 billion daily average for last year. About 1.23 billion shares were traded on Nasdaq, below the 1.81 billion daily average last year.

The number of shares advancing exceeded those declining by a ratio of 9 to 7 on the NYSE and by 8 to 7 on Nasdaq.

Overseas, Japan's Nikkei stock average fell 0.13 percent. In afternoon trading, Britain's FTSE 100 was up 0.79 percent, Germany's DAX index surged 1.61 percent, and France's CAC-40 rose 1.31 percent.

Reuters and The Associated Press contributed to this report.