The Yaksha asked, ‘Who is the friend of the exile? Who is the friend of the householder? Who is the friend of him that ails? And who is the friend of one about to die?’ Yudhishthira answered, ‘The friend of the exile in a distant land is his companion, the friend of the householder is the wife; the friend of him that ails is the physician: and the friend of him about to die is charity.’
In plain words: Yudhishthira says a traveler far from home has his companion as a friend, a family man has his wife, a sick person has the doctor, and a dying person has the good they did by giving to others.