It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that he said: "Whoever of Allah's creation greets you with salam, return his greeting, even if he is a Magian, for Allah, the Mighty and Majestic, says: 'And when you are greeted with a greeting, respond with one better than it' - this ruling is for the people of Islam - 'or return it (in the same way)' - this ruling concerns the people of shirk."
This report has already come earlier in the Book of Manners (Kitab al-Adab).