Edward B. Lewis, 86, the California Institute of Technology Nobel laureate who was the first to explain how genes control the development of organs during the early growth of an embryo, died July 21 at a hospital in Pasadena, Calif. He had cancer.

Dr. Lewis's studies explained how an essentially shapeless fertilized egg develops into an organism with a front and back, head and feet, and right and left sides. Although he performed his work with that ultimate laboratory tool, the fruit fly, researchers subsequently have shown that the same mechanisms operate in virtually all animals, including humans.

His work served as a crucial bridge between the old school of biology that focused on the structures of organisms and the newer, more radical school, which attempted to understand how those larger structures were molded by simple pieces of DNA.

Dr. Lewis and a friend were sophomores at Meyers High School in Wilkes-Barre, Pa., in 1933 when they saw an ad in Science magazine offering 100 fruit flies for $1.

They used the entire Meyers Biology Club treasury of $4 to purchase a batch and began growing the flies in a lab at school, stopping by every day to sort through the newly hatched generations with a magnifying glass to find the rare and exotic mutants that are the bread-and-butter of biological research.

They even discovered one, a mutant called "held-out," that is still used in genetics research today. Their after-school activity began a lifelong obsession with fruit flies that led Dr. Lewis to share the 1995 Nobel Prize for Medicine or Physiology with Eric F. Wieschaus of Princeton University and Christiane Nuesslein-Volhard of the Max Planck Institute for Developmental Biology in Germany.

When he began his research -- virtually all of it conducted at Caltech -- scientists knew that mysterious pieces of information called genes controlled individual traits in living organisms and that these genes were carried by chromosomes. But science did not know much more.

The discovery of the double-helix structure of DNA was still more than 20 years away, and identifying the structure of a single gene was further still.

But when researchers took the eight pairs of chromosomes that make up the blueprint of a fruit fly and put them under a microscope, they could see a definite structure -- a series of black and white bands that did not vary in healthy flies. Mutations showed up as visible changes in the banding.

Dr. Lewis's breakthrough discoveries began after World War II, when he crossbred two mutant flies and got offspring with "a perfect wing" immediately behind the normal wing.

In this fly, an entire segment of thorax had been deleted and replaced with a duplicate of the segment just in front of it. Dr. Lewis recognized that the mutated gene that caused the change played a crucial role in development. And because one gene alone could not bring about such massive changes, it was clear that the mutated gene was orchestrating the activity of a much larger number of genes needed to produce the wing segment.

Over the decades, he collected and crossbred other mutants and identified the genes that control the development of each fly segment. To the surprise of virtually all biologists, he showed that these control genes were lined up on the chromosome in the exact order that the segments appear in the fly's body, a principle that has subsequently been found to hold for other animals as well. It was for this achievement that he won the Nobel Prize.

Dr. Lewis's achievements could have been done only in fruit flies, said Bruce Alberts, head of the National Academy of Sciences, when Dr. Lewis received the Nobel Prize. "You can't knock out a single gene [in mice] and have the same effect you do in flies."

At Caltech's annual Halloween party, Dr. Lewis was famous for his highly inventive costumes. Once he came dressed as a painting by Rene Magritte, an artist he admired. Another time, he came dressed as a mutant two-tailed fruit fly.

Dr. Lewis and his wife, Pam, an artist whom he met in the laboratory at Caltech, raised tortoises and octopuses at their home in San Marino, Calif.

Besides his wife, survivors include two sons. A third son died in 1963.

Edward B. Lewis's studies at the California Institute of Technology explained how a fertilized egg develops into an organism.