Being able to flip a switch and control a brain sounds like the latest sci-fi movie, but it's a real thing in the field of neuroscience. It's called "optogenetics," and specific frequencies of light are used to activate neurons in the brain. Once activated those neurons, will fire and researchers can better understand the particular functions cells have. It's also possible to treat some conditions with optogenetics. It works by targeting ion receptors on the surface of brain cells. Normally these ion receptors are set in motion by neurotransmitters, but in cases of injury or disease, when the brain is not functioning correctly, optogenetics can attempt to evaluate and even treat the problem.
Fiber optic wires can be inserted into brain tissue and a pulse of light that lasts just one-thousandth of a second can open up the ion channels of whatever cell it hits. The field has only been around since 2005 when the first study of optogenetics successfully stimulated cells from a rat. They were not live in the animal, but in a petri dish, but that early research is what led to today's technology that is much more effective.