Actually a lot would depend on the nature of the vets injuries and how they were suffered. If the medical condition is going to be long term then they are usually medically retired so that their continuing care is provided under the military health care system; which would include help for a resulting addiction to prescribed pain medications.
If they were simply discharged, but had suffered injuries in the line of duty, then those injuries and any resulting conditions, including addiction to pain medications as a result of those injuries, can be treated via the VA. The quality of VA care is independent by region; there are actually some quality VA centers out there.
In either case, if the injuries were received in the line of duty, the vet could get care with a resulting addiction to prescribed pain medications.
Not trying to be argumentative. From what I have read, a large percentage of homeless people are vets, with a large percentage of them addicts. Also, doctors are scared to prescribe pain-killing medication in quantities sufficient to kill the pain (fear of addiction, fear of the WOD nailing them).