It really depends in what is causing the pain.
These issues can be interrelated. Malalignment of the foot can cause back and knee problems. Knee issues can cause compensation at the foot and back that result in pain. A thorough eval by an orthopaedists should start you in the right direction.