Fiqh-us-Sunnah Volume 4, Funerals and Dhikr, Fiqh 4.080.
Section : Condolences.
Offering one’s condolences to someone means sharing in his grief and encouraging him to be patient. It means enjoining patience to comfort the distressed person and to lighten his or her grief and misfortune.