It is narrated from Amr bin Dinar regarding Allah's command: "There is a ransom, so he may fast, or give charity, or offer a sacrifice." (__QUR_N__: Al-Baqarah: 196) that there is a choice in this; he may do whichever he wishes.
Hadith Referenceمسند الإمام الشافعي / كتاب الحج / 882
Hadith Takhrijاسناده ضعيف، لعنعة ابن جريج : اخرجه البيهقى 185/5 - وفى المعرفة السنن والآثار له (3175)۔