Sahih Bukhari Volume 002, Book 024, Hadith Number 490.

Narated By Ibn Masud : I heard the Prophet saying, "There is no envy except in two: a person whom Allah has given wealth and he spends it in the right way, and a person whom Allah has given wisdom (i.e. religious knowledge) and he gives his decisions accordingly and teaches it to the others."