The Supreme Court ruled yesterday that fee-setting agreements among doctors, even when they fix maximum prices, are automatically illegal under federal antitrust laws.

Only four justices voted for the ruling in the Arizona case, however, severely limiting its future use and guaranteeing additional litigation before the important issues involved are resolved.

Two justices, Harry A. Blackmun and Sandra Day O'Connor, disqualified themselves without explanation. Blackmun may have acted because of his long affiliation with the Mayo Clinic. O'Connor comes from Arizona, and may have had some contact with the parties in the case either as a judge and civic leader there or through her husband, a former partner in a major Phoenix law firm.

The case stemmed from a challenge by the State of Arizona to a "maximum fee schedule" agreed to by doctors who provided services to health insurance foundations. The schedule was supposed to define a ceiling on fees. But state officials charged that it also set a floor and that it was by definition illegal under the Sherman Act.

Pricing agreements among competitors in ordinary businesses are automatically violations of the law against price fixing. But the doctors, while clearly covered by antitrust laws under prior rulings, have argued that they should be treated differently because of the unique nature of the services they provide and the need to control the costs of health care.

Yesterday, Justice John Paul Stevens, writing for the plurality, said that, "as agreements among independent competing entrepreneurs," the doctors' price agreements "fit squarely into the horizontal-price-fixing mold."

The "claim that the price restraint will make it easier for customers to pay does not distinguish the medical profession from any other provider of goods or services," Stevens said.

Joining him were Justices William J. Brennan Jr., Byron R. White and Thurgood Marshall.

Justice Lewis F. Powell Jr. wrote a dissent joined by Chief Justice Warren E. Burger and Justice William H. Rehnquist.

Powell said that the fee plan "benefits, rather than injures," consumers of medical services and that to make it automatically illegal without a study in the courts of its true purpose and impact is to "lose sight of the basic purposes of the Sherman Act. As we have noted, the antitrust laws are a 'consumer welfare prescription'," he said.