Optogenetics is a technique for controlling the behavior of specific groups of nerve cells in the brain. Genetically engineered viruses carry light-triggered proteins into the brain of the animal; the viruses can be tailored to attach themselves to specific groups of cells.
The brain cells can then be activated by focused light; only those cells that are infected will respond to the light delivered into the brain by fiber optic strand.
The mouse pictured above has a fiber optic strand implanted in the top of its skull; when the light is turned on, the mouse is compelled to run in circles. This video shows what happens when this optogenetically-controlled animal is "switched on":
Other mice have been trained to prefer certain rooms within a maze by activating parts of the brain that suggest that a reward has been provided (like food) whenever they are in that room.
The intent of this research is to eventually find effective treatments for brain diseases like Alzheimer's, Parkinson's and epilepsy. Tailored optogenetic viruses could specifically work on the appropriate cells, rather than using chemicals that flood the entire brain.
This scenario should look familiar to science fiction fans as well. In a way, this is similar to the process by which a person is assimilated into the Borg in the ST:TNG series. The Borg start by injecting nanoprobes into the bloodstream which latch onto specific cells.
The idea that you could shine a light onto a person's brain and make them feel "rewarded" probably reminds Niven fans of the tasp from his 1970 novel Ringworld. This device is able to stimulate the pleasure centers in the brain remotely, without any sort of special surgical implant.
I'm also remembering sf stories in which remarkable inventions are created by "forcing" their genius creators to greater and greater focus and concentration. If I remember correctly, that method is used by the Mule in Asimov's Foundation series from the 1950's.
Update: Thanks to AJ for reminding me about the mindrot microbe from Vernor Vinge's 1999 novel A Deepness in the Sky.
"Focusing ennobles. It is the key to Emergent success, and a much more subtle thing than you can imagine. It's not just that we've created a psychoactive microbe. This is one whose growth within the brain can be controlled with millimeter precision - and once in place, the ensemble can be guided in its actions with the same precision."
"Don't you see? We can improve the attention-focusing aspects of consciousness: we can take humans and turn them into analytical engines."
(Read more about Vinge's focusing)