NEW YORK (AP) _ Joseph E. Seagram & Sons Inc. said Thursday it has agreed to sell seven distilled spirits brands for $372.5 million to a rival, Jim Beam Brands Co., part of an effort to focus on its premium-priced drinks.

Jim Beam executives said the purchase would improve their ability to capitalize on what they say is a trend toward less expensive brands.

The deal lifts Jim Beam into second place from third among the distilled spirits markets in the United States. behind IDV-Grand Metropolitan, according to figures from M. Shanken Communications, a publisher that tracks the industry.

Seagram, which had ranked second in 1990, will drop to fourth behind United Distillers, Shanken's research director Frank Walters said.

Seagram said the brands it agreed to sell account for about a quarter of the House of Seagram's sales in the U.S. market but only about 12 percent of its operating profit. It declined to disclose exact sales or profit figures.

Jim Beam, a unit of American Brands Inc. of Old Greenwich, Conn., said the brands had combined volume in excess of 5 million cases last year, and will increase its case volume by 35 percent.

Walters estimated the seven brands had $500 million in retail sales last year, and said Seagram got a fair price.

The brands sold are Lord Calvert Canadian Whisky, Calvert Extra and Kessler Blended American Whiskeys, Calvert Gin, Wolfschmidt Vodka, Ronrico Rum and the Leroux line of cordials.

The deal, subject to antitrust review by the government, is expected to close in December.

Edgar D. Bronfman, president and chief operating officer of Seagram's parent, The Seagram Co. Ltd., said the sale fits the company's strategy to focus on ''premium and core brands.''

Seagram sold the rights to 17 other distilled spirits brands to two separate companies in March 1989 as part of that strategy.

''They are more interested in being the most profitable'' than in selling more cases than their competitors, Walters said.

Hellen Berry, an executive with the consulting firm Beverage Marketing Corp., said Seagram is staking a claim on being known as a marketer of prestigious drinks with its latest sale of less expensive brands.

Its other U.S. liquor brands include Seagram's 7 Crown Blended Whiskey, Chivas Regal, Crown Royal and Seagram's VO Canadian Whiskies, Seagram's Extra Dry Gin, Martell Cognacs and Captain Morgan Original Spiced Rum.

''The current swing is toward drinking less and drinking better,'' she said. But she expects in the long run that people will probably go back to less expensive brands.

American Brands Chairman William J. Alley said he thinks that move is already underway to ''value-priced quality products.''

The new brands will strengthen Beam's competitive position in vodka, Canadian whisky, American blended whiskey and rum, he said.

Jim Beam, which may be best-known for its Jim Beam bourbon, markets Gilbey's vodka, Windsor Canadian whiskey and DeKuyper cordials.

Jim Beam had sales of $1 billion worldwide last year, and does not break out its U.S. sales figures.

The Seagram Co. had more than $6 billion in sales last year with products that include wines, fruit juices, coolers and mixes in addition to distilled spririts.