I'm sorry I shouldn't make light of this subject, but if it were me they said that to, I would have said,

"Why THANK YOU. I've really been trying hard to gain some weight and I think it looks good on me. I feel sooo much better. Really, thanks for noticing."

Then I'd walk away with a big smile on my face, all the while thinking "JERKS...."