This implies that current drug treatments, which are far less specific and often cause side effects, could also in part be working against themselves.

David Anderson, a professor of biology at the California Institute of Technology who also does research using optogenetics, compares the drugs’ effects to a sloppy oil change. If you dump a gallon of oil over your car’s engine, some of it will dribble into the right place, but a lot of it will end up doing more harm than good.

“Psychiatric disorders are probably not due only to chemical imbalances in the brain,” Dr. Anderson said. “It’s more than just a giant bag of serotonin or dopamine whose concentrations sometimes are too low or too high. Rather, they likely involve disorders of specific circuits within specific brain regions.”

So optogenetics, which can focus on individual circuits with exceptional precision, may hold promise for psychiatric treatment. But Dr. Deisseroth and others caution that it will be years before these tools are used on humans, if ever.

For one, the procedure involves bioengineering that most people would think twice about. First, biologists identify an “opsin,” a protein found in photosensitive organisms like pond scum that allows them to detect light. Next, they fish out the opsin’s gene and insert it into a neuron within the brain, using viruses that have been engineered to be harmless —“disposable molecular syringes,” as Dr. Anderson calls them.

There, the opsin DNA becomes part of the cell’s genetic material, and the resulting opsin proteins conduct electric currents — the language of the brain — when they are exposed to light. (Some opsins, like channelrhodopsin, which responds to blue light, activate neurons; others, like halorhodopsin, activated by yellow light, silence them.)

Finally, researchers delicately thread thin optical fibers down through layers of nervous tissue and deliver light to just the right spot.