"Abu Hurayrah reported that the Messenger of Allah (Peace and blessing of Allah be upon him) told this tale.
"A man felt very thirsty as he was walking along. He arrived at a well, went down into it and drank from its water. When he came out he noticed a dog that was panting and licking the mud because it was thirsty. The man said to himself: 'The dog is suffering what I was suffering a short while ago.' He went back into the well, filled his shoes with water and, holding them in his mouth, climbed up and gave the water to the dog to drink. Allah approved of his action and forgave his sins. The Companions asked: 'Shall we be rewarded for being kind to animals?' The Prophet answered: 'In every refreshed being there is reward.' "