Scientists have discovered a drug that is highly effective in treating one of the Third World's most devastating diseases, river blindness, and the manufacturer, Merck & Co., said yesterday that it is prepared to give away all the doses needed to eradicate the illness.

River blindness, which is common in much of tropical Africa and, to a lesser extent, in some parts of Latin America, including Mexico, afflicts an estimated 18 million people and threatens another 85 million, according to the World Health Organization. The disease has long been considered a major cause of suffering and, in some regions, a significant factor holding back economic development.

River blindness, which is also called onchocerciasis, is caused by a parasitic worm that is transmitted from person to person through the bite of a fly that breeds in rivers. The worm's microscopic larvae enter the human body and mature into adults that produce millions of new larvae. Over a period of years, these infiltrate much of the body, causing severe itching, raising disfiguring skin nodules and causing weight loss.

The most debilitating effects appear when larval worms colonize the eyes, causing scar tissue that can result in total and permanent blindness.

In some areas of West Africa, 15 percent of the population and 60 percent of those over 55 years of age are blind.

"We think there's a chance of being able to eradicate river blindness with the drug," said Dr. P. Roy Vagelos, chairman and chief executive officer of Merck & Co., in Rahway, N.J. Vagelos said that although Merck would prefer to sell its drug, the market is among the poorest people in the poorest countries, and such people could never pay.

"It's very safe and very effective," Vagelos said, "and it just makes sense to get it out to as many people as possible."

The drug has been approved by the French Directorate of Pharmacy and Drugs, the equivalent of the U.S. Food and Drug Administration. Many Third World countries rely on the French agency to assure the safety and effectiveness of new drugs.

Vagelos said Merck was setting up a panel of outside experts to review distribution plans submitted by afflicted countries. He said approved countries will be given as much of the drug as needed without charge, "as long as the stock market doesn't put us out of business."

The drug's brand name is Mectizan, and the generic name is ivermectin. It was discovered in 1975 and has been marketed for several years as a treatment for many parasitic infections in livestock. When the drug was found effective against an animal parasite related to the one that causes river blindness, it was tested on the human disease.

Subsequent research, led by Dr. Mohammed A. Aziz of Merck, has shown that a single low-dose pill given by mouth kills larval worms throughout the body and sterilizes the adult parasites that make new larvae. Although the blindness cannot be cured, progression of the disease can be stopped and blindness can be prevented if the drug is given early enough.

Two other drugs are already used to treat river blindness, but both have such a high risk of serious and sometimes fatal side effects that they must be given under a doctor's care. Mectizan's side effects are said to be so mild and transient that direct medical supervision is not necessary. The need for only one dose also makes it practical to reach large back-country populations that would be costly to visit repeatedly.

World health experts hope that if the parasites can be eliminated from human hosts, the flies that transmit the parasitic worms will have no source of new parasites and the spread of the disease will halt.