The fact that pain killers are linked to a cure for depression is not a surprise to me.
The euphoric effects go away after a few weeks of use. It is of no consequence in the addiction to the drug. They alter the brain chemistry by replacing the body's ability to produce endorphins.(natural pain killers)
The theory is that there may be deficiency in the endogenous opiod system of depressed people.
Just as some people do not produce enough (or too much) dopamine, serotonin, insulin, etc ... it would be naive to think that nobody has a deficient opiod modulation system. An overabundance of Mu receptors, or a low level of natural endorphin results in dysphoria (depression). What these opiods do is simply bring up the level of endorphins in a person's body that a non-deficient person would be expected to have.
When the drugs are withdrawn, the person returns to a depressed state. This is not necessarily from withdrawl (although most doctors will call it that), it may simply be a ruturn to the originally deficient state that the patient was in before they received the supplemental Mu agonists. If someone is deficient to begin with, the opiods don't necessarily "replace" the body's ability to produce endorphins (since little is being produced in the first place), rather, they bring the levels up to normal.
At least that is the theory, and from all accounts it would seem perfectly logical.