Stocks fell yesterday after two days of broad gains in the major indexes, but not enough to prevent the Dow Jones industrial average from posting its longest stretch of weekly gains in more than four years.

The Dow dropped 40.31 points, or 0.5 percent, to 8804.84. The Standard & Poor's 500-stock index slid 3.21, or 0.3 percent, to close at 930.55. The Nasdaq composite index inched up 1.19, or 0.1 percent, to 1468.74.

The Dow has risen for seven consecutive weeks, including 2.6 percent in the past week. The S&P 500 climbed 2.3 percent this week, and glimmers of hope for a tech rebound pushed the Nasdaq up 4.1 percent.

"Since the rally started on October 9, the best-performing stocks have been those that were the worst-performing stocks during the late summer sell-off," said Paul Hickey, an analyst at Birinyi Associates in Westport, Conn. "That's typical of the initial stages of strong market advances."

Yesterday the S&P was dragged down by ConocoPhillips's announcement that it would cut its capital expenditure by 25 percent, to reduce costs after the merger that made it the nation's third-largest oil company. The plan cast a shadow on energy stocks, whose combined fall contributed to more than a third of the decline in the index.

The Nasdaq, which has risen about 30 percent during the market's autumn revival, was buoyed this week by a bigger-than-expected profit at Hewlett-Packard and a report from Analog Devices of improved demand for its microchips.

Even when tech companies came out with bad news this week, "the market seemed to discount it and say that next year things will be better," Hickey said.

"Investors are looking through this valley to the other side," said Andrew Brooks, chief of equity trading at T. Rowe Price in Baltimore. The economic news reported this week suggests the recovery is progressing, he added.

Equity markets received a boost when the Labor Department released figures Thursday for weekly jobless claims that were lower than expected. Also, the Philadelphia Federal Reserve said that manufacturers in its region reported improved business in a monthly survey.

Shares of Cosi, the cafe chain serving up flat-bread sandwiches and exotic salads, gained 8.6 percent yesterday in its first day of trading. The 5.5 million shares, offered at $7 each, opened at $7.50, peaked at $10.35 and closed at $7.60.

Novell dropped 50 cents, to $3.38, a decline of nearly 13 percent, after announcing sales fell in its fourth quarter. The networking-software company narrowed its net loss for the quarter by cutting expenses.

Other Indicators

* The New York Stock Exchange composite index fell 1.49, to 491.63; the American Stock Exchange index fell 10.16, to 816.05; and the Russell 2000 index of smaller-company stocks rose 2.31, to 400.00.

* Advancing issues outnumbered decliners by 7 to 6 on the NYSE, where trading volume fell to 1.64 billion shares, from 2.42 billion on Thursday. On the Nasdaq, advancers outnumbered decliners by almost 9 to 8 and volume totaled 1.92 billion shares, down from 2.38 billion.

* The price of the Treasury's benchmark 10-year note fell $2.19 per $1,000 invested, and its yield rose to 4.18 percent, from 4.15 percent late Thursday.

* The dollar rose against the Japanese yen and the euro. In late New York trading, a dollar bought 122.88 yen, up from 122.70 yen late Thursday, and a euro bought 99.70 cents, down from $1.0012.

* Light, sweet crude oil for January delivery settled at $26.76 a barrel, up 41 cents, on the New York Mercantile Exchange.

* Gold for current delivery rose on the Commodity Exchange division of the New York Mercantile Exchange to $320.70 a troy ounce, from $317.40 on Thursday.