A Christmas buying spree, which surprised even the people at the checkouts, gave the nation's biggest retail chains December sales gains that broke both records and expectations.

The three biggest chains, Sears Roebuck, J.C. Penney and K mart yesterday reported December sales increased more than 20 per cent over 1976 numbers, and smaller retailers were nearly as successful.

The big three companies plus the next two largest, Woolworth and Ward's, sold $7.895 billion worth of goods during December. Their 19 percent gain represented an additional $1.3 billion in consumer spending.

Penney's said its 22.6 per cent sales increase, to $1.7 billion, was the largest monthly sales gain since April 1973 and the best December increase in more than 40 years.

For the first 11 months of its fiscal year, Penney's volume is up 12.1 per cent from last year, at $8.8 billion. Chairman Donald Seibert said selling started strong, got better and continued heavy the week after Christmas.

K mart, the number two retailer, reported a 21 per cent increase in sales to $1.7 billion and said sales for the first 48 weeks were up 18.9 per cent to $9.3 billion.

Sears, which projected a 10 per cent sales gain in mid-December and then raised the estimate to 14 per cent the week before Christmas, wound up with a 21.3 per cent increase.

Sales were $2.7 billion and the increase, $483 million, was the largest monthly gain in Sears' 91 years of retailing, chairman Arthur M. Wood said.

"We had predicated a record Christmas season," Wood said. "But sales continued to strengthen throughout December and surpassed our expectations. Our business is good in all sectors of the country."

At Montgomery Ward, chairman Edward S. Donnell reported, "Strong increases were registered in all parts of the country for retail and catalog sales."

Ward's sales for Decmeber were up 18.3 per cent to $795 million, the highest year-to-year gain for any month since April 1974 and the best December gain ever since 1973.

Ward's said toy sales "increased sharply due to highly competitive pricing," but most other companies said they had not increased their promotional efforts or cut prices to boost business.

The broad base of buying was indicated by the list of top-selling merchandise.

Ward's standout performers included women's and boy's sportswear, top line jewelry such as 14-carat gold necklaces and bracelets, more expensive watches and diamonds, refrigerators, records, tires, calculators, low-priced instant cameras and pocket cameras with built-in flash.

Penney's best-seller list included women's and children's sweaters, sleepwear and sportswear, men's shirts, sweaters and outerwear, fine jewelry, toys, sporting goods, home electronics, small appliances, and decorative home accessories.

The May Department Stores group - which includes the Hecht Co. - listed jewelry, boots, gloves and scarves as sales leaders, along with women's intimate apparel and sportswear and decorative home items.

May president David Babcock said customers showed "a marked preference for higher-quality merchandise" and said the company's department stores outperformed its catalog showrooms and discount stores.

May sales of $452 million increased 11.7 per cent and sales for the first 11 months were up 8.9 per cent to 2.1 billion.

The second largest department store company, May said its December increase was the best since February 1976.

Other reported sales:

F.W. Woolworth's December sales were up 10.8 per cent, for the first time topping the $1-billion-a-month sales were $5.2 billion, up 7.5 per cent.

Carter Hawley Hale, parent of Neiman Marcus, reported a 16 per cent increase to $286 million for December, the best monthly gain of the year. For the first 11 months, sales were $1.4 billion, up 10 per cent.

Dayton Hudson Corp. reported an 18.5 per cent gain for December to $397 million and a 14.7 per cent increase for the year to $1.9 billion.

G.C. Murphy Co. had a 9.2 per cent gain to $114 million for December and a 7.8 per cent increase for the 48 weeks to $634 million.

Zayre sales of $217 million in December were 14 per cent above the previous year and year-to-date sales of $1.2 billion were up 8.7 per cent.