Indeed, there are many forms of showing gratitude to the one who do favor to us. Repaying the favor is a distinctive characteristic of the Muslim even if the one who does the gratitude or the favor is a non-Muslim. The Prophet (peace and blessings be upon him) is reported to have said: “Whoever is done a favour and says to its doer, ‘May Allah reward you,’ then he has sufficiently expressed gratitude.”
Sheikh `Atiyyah Saqr former head of Al-Azhar Fatwa committee, states the following: Al-Bukhari and Muslim stated on the authority of Ibn `Abbas (may Allah be pleased with him): Once the Prophet entered a lavatory and I placed water for his ablution. He asked, “Who placed it?” When he was informed (it was me), he said, “O Allah! Make him (Ibn `Abbas) a learned scholar in religion.” It is also stated in Sahih Muslim that the Prophet (peace and blessings be upon him) prayed for Abu Qatadah in return for the latter’s taking care of the Prophet when he dozed on his camel while traveling, saying, “May Allah protect you, as you have protected His Messenger (from falling down).”
Moreover, At-Tirmidhi related in a hadith whose chain of transmitters is a good, authentic one according to him, that the Prophet (peace and blessings be upon him) said: “Whoever is done a favor and says to its doer, ‘May Allah reward you,’ then he has sufficiently expressed gratitude.” Furthermore, An-Nasa’i and Ibn Majah related that once the Prophet (peace and blessings be upon him) borrowed 40,000 [dinars] from `Abdullah ibn Abi Rabi`ah. Then, when the Prophet repaid him, he prayed for him and said: “May Allah bless you, your household and your property! Verily, the reward for lending is gratitude and repayment.”
It is an act of sunnah to do a good or better turn to whoever does one a favor, according to the Qur’anic verse that states,(When ye are greeted with a greeting, greet ye with a better than it or return it.) (An-Nisaa’ :86) Yet, sometimes one cannot repay the favor, so in this case it is sufficient to thank the doer and pray for him. To illustrate, it is stated that the Prophet (peace and blessings be upon him) said: “Reward whoever does you a favor. And if you are unable to reward him, then pray for him until you are certain that you have sufficiently showed thankfulness, for Allah is Thankful and He likes those who show thankfulness.” (Reported by Abu Dawud, An-Nasa’i and At-Tabarani). On the other hand, Abu Dawud and An-Nasa’i related: The Muhajirun (the Muslim emigrants from Makkah to Madinah) said to the Prophet: “O Allah’s Messenger! The Ansar (the Muslim supporters of Madinah) got the whole divine reward! We have never seen a people more openhanded if they have much to give and more comforting if they have little to give! They have sufficiently provided for us!” The Prophet (peace and blessings be upon him) replied, “Do you not praise them and pray for them in return?” They said, “Yes, we do.” The Prophet said, “This suffices that (i.e., you thus do them a good turn).”
The question here is, what if the doer of a favor is a non-Muslim? How can we thank and pray for him? The answer is that we invoke Allah to guide him to Islam and to make him enjoy good health. To illustrate, Ibn As-Sunni narrated that when the Prophet (peace and blessings be upon him) once asked for water to drink and a Jew provided water for him, the Prophet prayed for that Jew saying, “May Allah beautify you!” Afterwards, that Jew never turned gray until his death.