Ensure works well for this type of situation. I've had two rats with health problems/age related issues in the last year, and both liked Oxbow as lilspaz described, ground up and mixed with oat milk; Deb Ducommon sang the praises of soy milk for this application. If you really want to give him a treat, you could try giving him some organic chicken baby food--some would say this is too much protein for rats, but if your boy's losing weight, it might be worth a try and is only a buck or so. My rats went nuts for it. Finally, you could give him some of the critical care formula powder, which is specifically formulated for rats/animals that need to gain weight. My girl Pumpkin ate that for about a year. She had maloccluded teeth so had trouble eating a lot of foods. I would get it from the vet but you can also get it from Amazon. Fair warning, I made the mistake of buying the meat powder from Amazon for my boy who recently passed and he wanted nothing to do with it, so I'd go with another flavor.
The rat in your avatar is quite a looker!