Manufacturers of brand-name drugs suffered a major defeat yesterday when the Supreme Court blocked their efforts to cut off the supply of "look-alike" generic medications to pharmacies across the country.

The court struck down a lower court's ruling that the manufacturers of these imitations violated federal trademark laws.

Manufacturers such as Ives Laboratories contend that some pharmacists surreptitiously substitute the generic drugs for the more accepted brand-name products, deceiving the consumer and earning higher profits in the process. The court said that, although the pharmacists may be legally responsible for such deception, the manufacturers are not, unless it can be shown that they intentionally participated in the fraud.

The case was of immense significance both to the $8.5 billion pharmaceuticals industry, where it involved a multimillion-dollar struggle between manufacturers of brand-name drugs and producers of generic drugs, and to consumers of drugs.

The brand-name makers say that they spend years developing and marketing a product only to have it copied, down to the color and shape of the capsule, by generic producers once the brand-name patent expires.

In some instances, pharmacists substitute the "look alike" for the brand-name medication when filling prescriptions, the brand-name industry says.

To the big-name drug companies as well as some consumer groups, this is a fraud on consumers perpetrated by pharmacists, for which the generic manufacturers are responsible.

But to the generic manufacturers, and government antitrust officials, who filed a friend-of-the-court brief in the case, manufacturers of the "look-alikes" are engaged in an appropriate and legal form of competition, which should not be discouraged.

The case took on special significance because the patents on Valium, one of America's best-selling tranquilizers, will be expiring over the next three years.

Yesterday's case involved a drug called Cyclospasmol, made by Ives Laboratory, which is designed to improve blood flow in people with vascular diseases. Ives markets the white powder in pale blue and red and blue capsules.

Ives alleges that, after the patent expired in 1972, the manufacturers on the other side in yesterday's case (Inwood Laboratories Inc., et al., vs. Ives Laboratories Inc.) began making capsules containing the generic version--cyclandelate--identical in color, shape and size to Cyclospasmol. Ives said pharmacists began dispensing the substitute as if it were the real thing.

Ives sought a judgment that the generic labs violated the Trademark Act of 1946, also known as the Lanham Act. A district court found against Ives but was reversed by the U.S. Court of Appeals for the 2nd circuit.

Justice Sandra Day O'Connor, writing for the court yesterday, said the appellate panel improperly found that the challenged drug makers had participated intentionally in the deception practiced by the pharmacists.

The court was unanimous in the judgment. But three justices disagreed with O'Connor's reasoning.