The Messenger of Allah ﷺ said, "When one of you is invited, let him accept the invitation. If he is fasting, let him pray for the host, and if he is not fasting, let him eat."
قال رسول الله ﷺ: إذا دعي أحدكم فليجب فإن كان صائما فليصل، وإن كان مفطرا فليطعم.
Muslim narrated it in the Book of Marriage (1431), from Abu Bakr bin Abu Shayba, who said, Hafs bin Ghiyath narrated to us, from Hisham (that is, Ibn Hassan al-Qurdusi), from Ibn Sirin, from Abu Hurairah, and he related it.His saying, "let him pray," means let him supplicate for the people providing the food, asking for forgiveness and blessing and the like. The root meaning of salah in the language is supplication, as in the words of the Almighty, "and pray for them" [Tawbah 9:103].