A rally in Internet and technology shares boosted the Standard & Poor's 500-stock index and Nasdaq composite index, with eBay and Symantec reporting earnings that beat analysts' estimates.

"There's some momentum in the sector right now with these earnings reports," said Eric Thorne, who helps oversee $1.8 billion at Bryn Mawr Trust Co. in Pennsylvania. "Investors are seeing a great opportunity to get more involved with technology companies. Valuations are attractive."

A drop in Caterpillar shares dragged the Dow Jones industrial average lower on concern that costs at the world's largest maker of earthmoving equipment were too high last quarter.

The S&P 500 gained 2.83, or 0.3 percent, to 1106.49. The Dow fell for a third day, losing 21.17, or 0.2 percent, to 9865.76. The Nasdaq climbed 20.65, or 1.1 percent, to 1953.62 after Symantec, the maker of Norton Anti-Virus software, reported better-than-expected profit. Symantec rose $5.76, to $60.19.

An index of computer-related companies in the S&P 500 accounted for more than half the benchmark's advance. EBay gained $8.23, to $99.59, a record high. The world's biggest Internet auctioneer earned 28 cents a share, excluding certain costs, beating the average analyst estimate of 27 cents in a Thomson Financial survey.

Other Internet stocks gained. Yahoo, owner of the world's second-most-used Internet search engine, climbed $1.21, to $35.70. Google advanced $8.89, to $149.38, in regular trading and rose to $154.83 after exchanges closed. The owner of the No. 1 search engine said third-quarter profit doubled. Amazon.com rose $1.12, to $39.47. After the market closed, the online retailer reported third-quarter earnings that missed analysts' estimates, and shares fell to $36.15.

Caterpillar dropped $3.35, to $77.03. Unprecedented demand for the company's products from China, India and Russia forced Caterpillar to boost production, raising costs by $371 million in the quarter. Those costs limited profit gains for a second straight quarter, Chief Financial Officer Lynn McPheeters said.

A gauge of drugmakers lost 0.7 percent and was the biggest drag on the S&P 500 among 24 industry groups.

Merck shed 14 cents, to $31.26. The U.S. drugmaker, which withdrew its Vioxx painkiller in the biggest drug recall ever, reported third-quarter sales of $5.54 billion. Analysts in a Thomson poll expected $5.93 billion. Merck's third-quarter profit tumbled 29 percent from a year earlier.

Amgen lost $2.13, to $54.28. The U.K. patent for its Epogen anemia treatment, the biotechnology company's best-selling drug, was ruled invalid by Britain's highest court.

Sears Roebuck fell $3.18, to $33.74. The largest U.S. department-store chain posted an unexpected third-quarter loss of 29 cents a share and cut its annual profit forecast, signaling that chief executive Alan Lacy's strategy to boost sales may not be working.

Other Indicators

* The New York Stock Exchange composite index rose 24.01, to 6563.49; the American Stock Exchange index rose 4.38, to 1303.74; and the Russell 2000 index of smaller-company stocks rose 6.53, to 576.66.

* Advancing issues outnumbered declining ones by 2 to 1 on the NYSE, where trading volume fell to 1.67 billion shares, from 1.69 billion on Wednesday. On the Nasdaq Stock Market, advancers outnumbered decliners by 13 to 8 and volume totaled 1.98 billion, up from 1.64 billion.

* The price of the Treasury's 10-year note fell 94 cents per $1,000 invested, and its yield rose to 4.00 percent, from 3.99 percent on Wednesday.

* The dollar fell against the Japanese yen and the euro. In late New York trading, a dollar bought 107.45 yen, down from 108.19 late Wednesday, and a euro bought $1.2616, up from $1.2587.

* Light, sweet crude oil for December delivery settled at $54.47, up 6 cents, on the New York Mercantile Exchange.

* Gold for current delivery rose to $424.40 a troy ounce, from $423.50 on Wednesday, on the New York Mercantile Exchange's Commodity Exchange.