He has to fast and stop watching things that provoke his desire and to surround himself with practicing Muslims!
The way out is repenting sincerely, feeling deep remorse, getting married or fasting. And putting the things in your life straight, such as getting rid of bad company, quit wasting time, refrain from sins such as watching movies, using the TV and Internet for wrong things and seek the pleasure of Allah by learning the deen and doing good deeds, constantly. Allah doesn’t burden a soul beyond what it can bear and masturbating is a sin that one can stay away from, just like millions of Muslims!