Magruder Inc., which owns nine supermarkets, yesterday bought seven of nine stores operated by Cook's Supermarkets to create the third-biggest grocery chain in the Washington area.

The combined Cook's and Magruder stores would have annual sales of about $200 million, well ahead of the estimated $160 million in sales Jumbo Food Stores rang up to hold the No. 3 ranking in the Washington area in 1985, according to the annual survey of area grocers conducted by the trade journal Food World.

But the enlarged Magruder chain is dwarfed by Giant Food Inc. and Safeway Stores Inc., the area's biggest food retailers, with joint sales of more than $2.6 billion, accounting for about 75 percent of the Washington area's retail food sales.

In a complicated transaction, Cook's sold the seven supermarkets to a giant St. Louis-based food wholesaler and manufacturer, Wetterau Inc. Wetterau turned around and sold the assets and inventory to Magruder and sublet the store space to the Rockville-based chain.

Officials at Cook's and Magruder declined to reveal the sale price, but industry sources estimated that the transaction, in which Wetterau essentially acted as a middleman, was worth about $6 million.

Mark B. Polsky, vice president of Magruder, said that Magruder executives were talking last September to officials of Wetterau's regional headquarters in Reading, Pa., about buying grocery products from the wholesaler when the officials said that the Cook's chain was for sale.

Polsky said that the seven available stores were in "areas that we wanted to expand, to fill out our coverage of the area."

Cook's, which is owned by Robert and Bruce Cook, will keep its stores in Silver Spring and Beltsville. Industry sources said problems with leases and the small size of the two stores made them unattractive for the deal. The Cook brothers took over the family chain in 1963.

Magruder Inc. was founded as a family supermarket in 1875, but Polsky said the Magruder family sold the chain in 1967.

Wetterau, the third-biggest food wholesaler in the nation, has been seeking a foothold for that business in the lucrative Washington market, industry sources said. The area has become more attractive to big food wholesalers because several nationwide chains have folded operations and their stores have been taken over by independent chains like Cook's and Magruder.

Among the chains that have closed their Washington operations in recent years are Pantry Pride and Memco. The giant chains, including Safeway and Giant, run their own warehouse operations, but smaller chains do not have the buying clout or the sales to run their own wholesale buying and warehousing operations. Instead, they buy from wholesalers such as Wetterau.

Industry sources said Wetterau's sales topped $3 billion in 1985. A diversified wholesaler and manufacturer, it makes frozen foods and warehouses and distributes nearly all kinds of grocery store products, from canned goods to toilet tissue to fresh meat.

Wetterau also has ventured into the retail food business. In recent years, it has bought food chains in Pennsylvania and Western Maryland that it operates from its Reading regional headquarters. But industry sources said that Wetterau's primary interest is food wholesaling and distribution.

Magruder's Polsky said that the chain and Wetterau have a "handshake agreement" that Magruder will buy groceries from Wetterau. But Polsky said that Magruder has not yet decided what products it will buy from the St. Louis-based wholesaler.

Polsky said that Magruder signs will go up on the former Cook's supermarkets about the middle of next week. He said that all former Cook's employes at the seven stores will become Magruder employes and none will lose his or her job as a result of the takeover.

Magruder will buy Cook's stores in Laurel, Temple Hills and Andrews Air Force Base in Maryland, and Hybla Valley, Alexandria, Springfield and Falls Church in Virginia, Polsky said.

Magruder already operates stores on upper Connecticut Avenue in Northwest Washington, and has two stores in Rockville and a store in Bowie and Annapolis in Maryland, and in Annandale, Vienna, Fairfax and Manassas in Virginia.

Cook's and Magruder have been among the most successful independent food-store chains here, but analysts said that the sharply bigger Magruder operation is unlikely to have much impact on the competitive structure of food retailing in the Washington area, which long has been dominated by Giant Food, which is based in Landover, and Safeway, which is based in Oakland, Calif.

Giant was estimated by Food World to have 1985 sales of nearly $1.5 billion in its 93 stores in the area, while Safeway, with 125 stores, was estimated to have sales of $1.16 billion here.

The combined Cook's and Magruder would have slightly less than 5 percent of the area's food sales compared with Giant's 42 percent and Safeway's nearly 33 percent.

Jumbo, a family-owned chain based in Landover, was estimated to have rung up about 4.5 percent of the grocery sales in the area, while Food-A-Rama, with roughly $156 million in sales, accounted for 4.4 percent of the market.