Praise be to Allaah.
The basic principle is that offering the sacrifice is better than giving its price in charity, because of what results from that of drawing close to Allah by offering a sacrifice and giving charity, and performing this ritual in front of one's family and children, and keeping this ritual alive among the people, because the sacrifice is one of the symbols of Islam.
Ibn al-Qayyim said in Tuhfat al-Mawdood (p. 65):
Sacrifice at the appropriate time, such as during Hajj and on Eid al-Adha, is better than giving its price in charity even if one gives more, because offering a sacrifice and shedding blood is what is required, and it is an act of worship that is mentioned alongside prayer, as Allah says (interpretation of the meaning):
Therefore turn in prayer to your Lord and sacrifice (to Him only)
Say (O Muhammad): Verily, my salaah (prayer), my sacrifice, my living, and my dying are for AllÃ¢h, the Lord of the 'Alameen (mankind, jinn and all that exists)
In every religion there is prayer and sacrifice and no other acts of worship could take their place. Hence if you give charity equivalent to many times the price of the sacrifice offered in Hajj, it can never take its place. The same is true of udhiyah (qurbaani). End quote.
The scholars of the Standing Committee for Issuing Fatwas said:
Offering the udhiyah (qurbaani) on the Muslim's behalf and on behalf of the (living) members of his family is a confirmed Sunnah (Sunnah mu'akkadah) for the one who is able to do it, and offering it is better than giving its price in charity.
End quote from Fataawa al-Lajnah al-Daa'imah, 11/419
If this relative is sick and in urgent need of treatment and medicine, then helping him in his sickness and striving to find treatment for him takes precedence over udhiyah, especially if his sickness is severe and he is in urgent need of help, and there is no one among his relatives or friends who can help him.
Abd al-Razzaaq narrated in al-Musannaf (8156) from al-Thawri, from Imraan ibn Muslim, from Suwayd ibn Ghaflah that he said: I heard Bilaal say: To give its price (i.e., the price of the udhiyah) in charity to an orphan or a debtor is dearer to me than sacrificing it. He (the narrator) said: I do not know whether Suwayd said it by himself or it is the words of Bilaal.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
Hajj (i.e., voluntary Hajj) done in the prescribed manner is better than charity that is not obligatory. But if he has relatives who are in need, then giving charity to them is better, who need his charity for his maintenance. But if both actions are voluntary, then Hajj is better, because it is an act of worship that is both physical and financial. By the same token, offering a sacrifice for aqeeqah or udhiyah is better than giving its price in charity. End quote from al-Fataawa al-Kubra, 5/382
Shaykh Ibn Uthaymeen (may Allah have mercy on him) said:
If it is a matter of choice between udhiyah and paying off debt on behalf of a poor person, then paying off the debt is better, especially if the debtor is a relative.
End quote from Majmoo Fataawa wa Rasaa'il Ibn Uthaymeen, 13/1496
And Allah knows best.