foam roller or a tennis ball (on your back while lying down) are all forms of self masssage. It's best to combine with stretching the those same muscles as soon as you've massaged them; this will promote good alignment and if you're lifting, strength gains. Increases blood flow, removes knots, improves body alignment.
If your interested in this sort of thing, check out "myofascial release."
But be careful, if you're trying to solve musculo-skeletal pain, this is one of a few things you need to do to resolve the root of the problem. For example, my gf likes to use a tennis ball on her back, which solves the immediate pain, but doesn little to remedy the spinal alignment issues that are causing the pain in the first place.