While a man was walking along a road, he became very thirsty and found a well. He lowered himself into the well, drank, and came out. Then [he saw] a dog protruding its tongue out with thirst. The man said: "This dog has become exhausted from thirst in the same way as I." He lowered himself into the well again and filled his shoe with water. He gave the dog some water to drink. He thanked God, and [his sins were] forgiven. The Prophet was then asked: "Is there a reward for us in our animals?" He said: "There is a reward in every living thing."
Fiqh-us-Sunnah, Volume 3, Number 104 - Sunni Hadith