Hello,
Is your rat aging? Once my old boy Elton turned three he wasn't able to eat solid food, but we were able to get him by for a few more months using a mixture of baby food and
Nutri-Cal, a high calorie nutritional supplement for cats and dogs. It's a rather dense brown paste, but if you mix it with something yummy your rat should eat it just fine. It's pretty cheap too.
Hope this helped at least a little!