It is narrated from Hazrat Abu Huraira (may Allah be pleased with him) that I heard the Noble Prophet (peace and blessings be upon him) saying: If someone is invited to a meal and he is not fasting, then he should eat, and if he is fasting, then he should pray for them.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 7749