Sears, Roebuck & Co., the nation's largest retailer, reported yesterday that its fourth quarter profits declined by nearly 20 percent, although its 1977 sales and profits rose to record levels.

The unexpected drop for the quarter caught the stock market off guard and triggered a selling wave that put the issue at the top of the New York Stock Exchange's most active list. Shortly after the wire service releases of the earnings report, Sears' stock fell 1 5/8 to $23. At the close, the stock was off 1 7/8 at $22.75.

The company said earnings for the quarter fell to $251.79 million (78 cents a share) from $312.75 million (98 cents) a year ago. Sales increased to $4.996 billion from $4.427 billion.

For the year, profits jumped 20.7 percent to a record $837.98 million ($2.62) from $694.12 million ($2.18) for 1976. Sales rose 16.2 percent to a record $17.22 billion from the previous height of $14.95 billion last year.

Sears' Chairman Edward Telling attributed the earnings decline to a deliberate marketing strategy. He said the company cut merchandise prices in order to boost its market share, a move which boosted full-year and fourth-quarter sales, but hurt fourth-quarter earnings because of "strong demand for promotionally priced merchandise at lower margins." Sear's full-year sales rose 16.2 percent compared with the general retail average of 10.7 percent.

Telling said the price reductions were made in anticipation of the record performance of the company's Allstate group. The group's contribution to profits jumped 37.5 percent for the fourth quarter, to $110 million against $80 million last year, and nearly doubled for the full year, to $417 million from $210 million.

Telling said, "Sears not only sold more goods in the same stores to the same customers, but attracted many new customers who had not been buying at Sears.

Capital expenditures in 1977 were $256 million compared with $229 million in 1976. Telling said capital outlays are expected to exceed $300 million this year.

He said the outlook for 1978 is favorable, "although at a slower rate of increase than last year."

Pillsbury Co., the packaged foods and flour giant, reported that third-quarter and nine-month sales and earnings gained strongly over the year earlier periods.

"The substantial gains came despite unusually severe weather conditions which adversely affected our restaurants and agri-proudcts businesses," said Chairman William Spoor.

Earnings from continuing operations for the third quarter ended Feb. 28 were $14.1 million (81 cents a share), up 11 percent from $12.7 million (73 cents) a year ago. Sales were $398.6 million, up 12 percent from $355.1 million.

For the nine months, earnings from continuing operations were $54.6 million ($3.14) a 9 percent increase over the $49.9 million, or $2.28 a share, a year earlier. Sales were $1.21 billion, up 7 percent from $1.12 billion a year earlier.