Deep brain stimulation, or, "That's funny..."
Marvin Minsky once said that the human mind operates at only one tenth of its full capacity because the rest is taken up by the operating system's overhead. I always thought that was kind of a funny statement. When you get right down to it, nobody's really sure how the brain functions, or even how the mind operates inside of the 2.8 pounds of matter behind your eyes. People have variously been stabbed in the head (ye gods), lost a full quarter of brain mass in accidents, and even had entire hemispheres surgically excised and gone on to live healthy, happy, amazingly functional lives. I could go on for a while about how amazing the brain is and the majesty of its myriad weird functions but I really won't be doing it any justice. I also won't be able to do any justice to the sprawling family of chemo-electrical weirdness known as mental illness. Medical science still doesn't understand exactly how the brain functions so trying to treat something as commonplace as clinical depression can be something of a crapshoot. For some people cognitive therapy works pretty well; for others antidepressants and counseling do the trick. For still others surgical intervention of one sort or another is necessary.
At first deep brain stimulation was limited to treatment of certain neuromuscular diseases like Parkinson's disease, but it was later found to be effective for other ailments, such as depression, cluster headaches, and even certain forms of addiction as well as certain manifestations of mental illness. The treatment is simple in principle though it requires brain surgery (which is never trivial): a fine cluster of electrodes is inserted into the brain and come to rest inside of one or more structures of the brain (sometimes both hemispheres of the brain are involved, sometimes only one) which are associated with the disorder in question. The electrodes are connected to a microcomputer implanted near the collarbone (or lower, sometimes in the abdomen) which generates programmed combinations of voltages, frequencies, and pulse widths. The signals transmitted through the electrodes dampen the chemoelectrical activity of the region somewhat and correct (or at least lessen) the problem. While it works very well, it doesn't function in as linear a manner as one would hope.
The brain is a very densely interconnected marvel of computing power. One way of looking at it is as a fantastically complex network of individual processing elements (neurons). Another way of looking at the brain is as a fantastically complex network of smaller networks (regions of connected neurons that make up what we normally think of as the "parts of the brain", like the visual cortex or the hippocampus) which can influence one another directly or indirectly. For example, a DBS unit which stimulates the subgenual area (which is involved in emotional response) might also affect the processing of parts of the prefrontal cortex (which is also involved in processing and evaluating emotions). Sometimes the effects are what doctors expect but not the causes - the example given in the article is stimulation of the nucleus accumbens not provoking a reaction there but was instead in the prefrontal cortex and subgenual area. Sometimes DBS doesn't work at all for reasons which are poorly understood and probably highly specific to the patient. Sometimes pinging the subgenual area with the DBS unit results in activation of the amygdala instead, which doesn't do what was intended.