It is narrated from Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When one of you is invited to a meal, let him accept. If he is not fasting, let him eat; and if he is fasting, let him supplicate for blessing (for them)."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 10517