I got rid of chronic pain I had for 4 years in 4 weeks by reading "The Divided Mind" by John Sarno. I'd highly recommend it.
And, as other's have pointed out, a wandering mind is part of meditation. The beneficial part of meditation comes from that act of noticing your wandering mind and bringing it back to focus.