Many people suffer from some form of chronic pain, and it is one of the most important issues in the world, as almost all problems generally come down to feeling pleasure or pain. This is not an easy question to answer, as it is a thing which has plagued mankind since the beginning of time.
The first thing I want to make clear is that I am not a doctor, and it it important to seek medical advice if pain persists, but if you are dealing with chronic pain, the odds are you have already seen many doctors over the years.
The first thing to establish is the cause of the pain, and whether there is anything medical that can be done to treat the source. For example, physiotherapy, healthy living, or even surgery could be options that could help to relieve the pain, and stop it at the source, but if none of these things work, then there are some other options.
The oldest way to try to relieve pain is by focusing the mind. Buddhism is a philosophy that at it's core is all about how to relieve suffering. Through meditation, deep breathing and stretching, it is possible to train the mind to drift off to a sort of waking sleep, where you are conscious, but also not.
The idea is that while you are alive, you are also made up of molecules that are dead, and that by stopping yourself from thinking, you can get in touch with the "endless void", or the energy that everything is made of.
It can take many years to train the mind successfully to switch off, but Zen masters claim to be able to spontaneously feel intense happiness whenever they want, and even stop their own heart from beating. The mind is a powerful thing.
Exercise is a way to release natural endorphins, and it's very important to stay as healthy as you can, as things like smoking and drinking can actually cause you more pain, and don't really work that well to mask the chronic pain.
Keeping youself occupied with an activity or primary focus that you are passionate about is very important, as if you are thinking about one thing, you are less likely to be thinking about the other.
Dealing With Chronic Pain Using Drugs
If all else fails, drugs can be of some help as a temporary solution to chronic pain, but it is important to realize that they don't work forever.
If you are going to take opiates or things like that, it's probably best to only take it every now and then, or you will get addicted, and develop immunity to the drugs.
With certain types of chronic pain, there is no real choice but to keep upping the dosage until the drugs kill you, and usually a doctor will only prescribe that sort of pain relief to someone who is going to die anyway.
Bare in mind, there are other types of drugs which doctors don't prescribe which may help with pain, such as marijuana, ecstasy, nitrous oxide (found in cream whippers), alcohol etc, but generally these drugs can cause as many problems from side effects as benefits in the treatment of chronic pain.
The official position is that no other drug has been found that has the same pain killing effects as opiates without the intensely addictive side effects, but that's not entirely true, it's just that the drugs which can kill pain without being addictive kill the pain by killing brain cells, which can obviously be a problem if you like using your brain, like I do. I had my IQ tested though, still above average.