Abu Hurayrah (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "Horses are of three kinds: for one man a source of reward, for another man a covering, and upon a third man a burden. As for the horse that is a source of reward for a man: he ties it up in the path of Allah and lengthens its tether in a pasture or a garden. Whatever it eats from the pasture or the garden within the length of its tether, its good deeds go to that man. If that tether of his breaks and it gallops over one or two hillocks, he will be rewarded even for its footprints and its dung. If, passing by a river, it drinks water without his having intended it, that will be good deeds for him. The one who ties up a horse to be free of need, for chastity and as a covering, and then does not forget the right of Allah in its neck and its back, for him it is a covering. The one who keeps a horse out of pride, showing off and hostility towards the people of Islam, for him it will be a calamity and a burden." The Messenger of Allah (peace and blessings be upon him) was asked about donkeys, and he (peace and blessings be upon him) said: "Nothing has been revealed to me concerning them except this one comprehensive verse: 'So whoever does an atom's weight of good will see it, and whoever does an atom's weight of evil will see it.' [Surah al-Zalzalah: 7-8]."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السبق والرمي / 19745