Dr. Barres became interested in the degeneration of brain function during an internship and residency at Weill Cornell Medical College and returned to school to study it, this time at Harvard Medical School, receiving a Ph.D. in neurobiology there in 1990.

A postdoctoral fellowship took Dr. Barres to University College London and the lab of Dr. Martin Raff, who was studying glia, the cells in the human brain that are not nerve cells. Dr. Barres went to Stanford in 1993, taking his interest in glia with him. In 2008 he became chairman of the neurobiology department.

“Ben pioneered the idea that glia play a central role in sculpting the wiring diagram of our brain and are integral for maintaining circuit function throughout our lives,” said Thomas Clandinin, a professor of neurobiology at Stanford who assumed the chairmanship in April 2016 when Dr. Barres’s cancer was diagnosed. “People had thought glia were mere passive participants in maintaining neural function. Ben’s own work and that of his trainees transformed this view entirely.”

Dr. Barres and researchers working with him studied the three types of glial cells and their role in proper neonatal brain development, as well as the possibility that inflamed glia are a cause of neurodegenerative disorders. Stanford said Dr. Barres published 167 peer-reviewed papers in his career.

To many, though, just as important as his research was his willingness to speak out on sexism and related issues. He called for more day-care support for women in the sciences who also wanted families. He criticized tenure systems that seemed weighted against women. He was furious at male colleagues who bragged about having sex with their female students.

But he also faulted women for being part of some of these problems — particularly women who succeeded despite the obstacles and then acted to protect their hard-won turf.

“Accomplished women who manage to make it to the top may ‘pull up the ladder behind them,’ ” he wrote in the Nature article, “perversely believing that if other women are less successful, then one’s own success seems even greater.”