sounds like he contracted hiv
A virus can cause this. He needs to eat small fequent meals, soft foods that are easily swollowed, cold foods, stay away from whitening toothpastes, and mouthwashes containing alcohol, and not brush the affected area. They normally will prescribe pain medication to allow the person to eat. I hope they gave him more than just one pain pill.
Rinse his mouth with warm water and a small amount of baking soda every time he eats.
Avoid acidic or salty foods. But if he isn't doing better in a few days I would have him checked out again. There are other things than a virus that can cause mouth sores.