As life evolved, animals needed a more complex brain for finding food and sex and so developed a central nervous system. But the gut's nervous system was too important to put inside the newborn head with long connections going down to the body, Dr. Wingate said. Offspring need to eat and digest food at birth. Therefore, nature seems to have preserved the enteric nervous system as an independent circuit inside higher animals. It is only loosely connected to the central nervous system and can mostly function alone, without instructions from topside.

This is indeed the picture seen by developmental biologists. A clump of tissue called the neural crest forms early in embryogenesis, Dr. Gershon said. One section turns into the central nervous system. Another piece migrates to become the enteric nervous system. Only later are the two nervous systems connected via a cable called the vagus nerve.

Until relatively recently, people thought that the gut's muscles and sensory nerves were wired directly to the brain and that the brain controlled the gut through two pathways that increased or decreased rates of activity, Dr. Wingate said. The gut was simply a tube with simple reflexes. Trouble is, no one bothered to count the nerve fibers in the gut. When they did, he said, they were surprised to find that the gut contains 100 million neurons -- more than the spinal cord has. Yet the vagus nerve only sends a couple of thousand nerve fibers to the gut.

The brain sends signals to the gut by talking to a small number of "command neurons," which in turn send signals to gut interneurons that carry messages up and down the pike, Dr. Gershon said. Both command neurons and interneurons are spread throughout two layers of gut tissue called the myenteric plexus and the submuscosal plexus. ("Solar plexus" is actually a boxing term that refers simply to nerves in the abdomen.) Command neurons control the pattern of activity in the gut, Dr. Gershon said. The vagus nerve only alters the volume by changing its rates of firing.

The plexuses also contain glial cells that nourish neurons, mast cells involved in immune responses, and a "blood brain barrier" that keeps harmful substances away from important neurons, Dr. Gershon said. They have sensors for sugar, protein, acidity and other chemical factors that might monitor the progress of digestion, determining how the gut mixes and propels its contents. "It's not a simple pathway," he said. "It uses complex integrated circuits not unlike those found in the brain."

The gut's brain and the head's brain act the same way when they are deprived of input from the outside world, Dr. Wingate said. During sleep, the head's brain produces 90-minute cycles of slow wave sleep punctuated by periods of rapid eye movement sleep in which dreams occur. During the night, when it has no food, the gut's brain produces 90-minute cycles of slow wave muscle contractions punctuated by short bursts of rapid muscle movements, Dr. Wingate said.

The two brains may influence each other while in this state, Dr. Wingate said. Patients with bowel problems have been shown to have abnormal rem sleep. This finding is not inconsistent with the folk wisdom that indigestion can produce nightmare.