Excerpt from the Sahih Bukhari by Al-Bukhari

The Messenger of God said: “While a man was walking on the road, his thirst grew strong and he found a well and descended into it and drank and was leaving, when he saw a dog hanging out its tongue and licking the ground from thirst, and the man said, ‘This dog’s thirst is like the thirst I had,’ and he went into the well again, filled his shoe with water, and held it between his teeth (while he climbed out), and gave the dog to drink. And God approved of his act, and pardoned his sins.” They said, “What, Messenger of God, shall we be rewarded for what we do for animals?” He replied, “Yes. There is a reward on every living creature.” — from The Sahih Bukhari

Muhammad Ibn Ismail Ibn Ibrahim Ibn al-Mughirah Ibn Bardizbah al-Bukhari (aka Al-Bukhari) (810–870) was a well-known Persian Islamic clergyman and scholar best known for authoring the Sahih Bukhari, which Sunni Muslims consider the most faithful of all the hadith — or collections of traditional teachings — in Islam. After the Koran, the hadith are considered the most authoritative books in Muslim theology.