Susumu Tonegawa, a Japanese molecular biologist who teaches at the Massachusetts Institute of Technology, was awarded the 1987 Nobel Prize in Medicine yesterday for his work illuminating how cells of the body's immune system are able to produce chemical weapons against millions of different substances.

In announcing the award, Sweden's Karolinska Institute praised Tonegawa's "series of ingenious experiments" during the 1970s showing that the genes that carry the instructions for these weapons, called antibodies, are shuffled within developing cells to create millions of possible combinations. The discovery answered a central question in immunology: How can cells, which start out with only a limited number of genes, manufacture so many millions of kinds of antibodies?

"We were trying to find out how the immune system works," Tonegawa said in an interview yesterday. "This problem was very emotionally debated because it had been there for so many years."

Tonegawa, 48, a Japanese citizen who conducted much of his ground-breaking research at the Basel Institute for Immunology in Switzerland, said he learned of the award when a reporter called him at home early yesterday morning. "I'm very surprised, actually," he said. "I did not expect the committee would pick our work."

But other scientists in the field said Tonegawa deserved the prize, calling his findings fundamental to understanding the genetics of the immune system.

"Just as you have 26 letters in the alphabet forming whole libraries of books, or 52 playing cards making up innumerable poker hands," the cell's ability to shuffle genes explains how the immune system is able to produce such a diversity of antibodies, said Dr. Thomas Waldmann, chief of the metabolism branch of the National Cancer Institute.

The discovery has already had major scientific implications, Waldmann said. For instance, researchers have found that errors in gene rearrangement can lead to development of certain cancers. And learning to manipulate genes carrying the instructions for antibodies has allowed scientists to design so-called monoclonal antibodies for novel purposes, such as devising new cancer treatments and inventing new diagnostic tests.

Antibodies are Y-shaped protein molecules that form a vital part of the body's defenses against infections by bacteria, viruses and other organisms. They are manufactured by special cells of the immune system called B cells.

Each B cell makes only one type of antibody, designed to recognize and bind to a specific foreign substance called an antigen, much as a key fits into a lock.

When an antibody binds to its antigen, that signals the immune system to attack and destroy the foreign invader. Antigens can also bind to antibodies poised on the surface of a B cell, stimulating the cell to multiply and produce more antibodies.

Tonegawa said that when he began his experiments, there were two opposing theories to explain how B cells developed. One theory held that the genes within a cell did not change or move around, so that millions of types of B cells would have to exist to account for the millions of types of antibodies made by the body.

The other theory, which Tonegawa proved correct, held that genes could rearrange or shuffle inside B cells as they mature, producing many possible combinations. Each combination would code for a different type of antibody.

Tonegawa's 1976 paper in the journal Proceedings of the National Academy of Sciences proved the theory of gene rearrangement by showing that the DNA, or genetic material, containing the instructions for part of an antibody, was arranged differently on the chromosome of an adult mouse cell than it was on the same chromosome in a mouse embryo cell.

Further work by Tonegawa and others, including Dr. Philip Leder of Harvard Medical School and Dr. Leroy Hood of the California Institute of Technology, proved that the genes containing instructions for the protein chains that make up an antibody are spliced and shuffled as a B cell develops, much as a railroad controller uncouples and recouples the cars of a freight train.

Tonegawa is the first Japanese to win the medicine prize, which this year is worth about $340,000. He is the sixth Japanese Nobel laureate in any category.

Born in Nagoya, Japan, he received a bachelor of science degree from Kyoto University and a doctorate from the University of California at San Diego. After postgraduate studies at the Salk Institute in San Diego, he did research at the Basel Institute for Immunology from 1971 to 1981. He became a professor of biology at MIT in 1981.

Last month, Tonegawa, Leder and Hood were named as recipients of the 1987 Albert Lasker medical awards for their work on genetics of the immune system. Some scientists yesterday expressed surprise that no other researcher had been named to share the Nobel prize with Tonegawa, but they acknowledged that his 1976 paper was the first to prove the gene rearrangement theory.

Tonegawa said he and other researchers subsequently found that similiar rearrangement also occurs in T cells, another kind of immune-system cell. The molecular biologist said he did not know whether similar gene-shuffling occurs during the development of other kinds of cells in the body.

"We have no idea. Maybe they don't," Tonegawa said. "On the other hand, many biological systems have not been studied at this level. We should keep our minds open."

In 1983 Tonegawa was a member of an MIT research team that concurrently with researchers elsewhere, isolated and cloned a molecule on the surface of another kind of immune cell called a T cell. This molecule, called the T-cell receptor, binds to an antigen much like an antibody does, stimulating the T cell to multiply.

Tonegawa said he is now studying a newly discovered variety of T cell that contains a different receptor. "We don't know what they do," he said. "They must do something important."

Tonegawa will receive his award at a ceremony in Stockholm Dec. 10.