It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that the Companions (may Allah be pleased with them) disliked spending anything on their polytheist relatives, so they asked (the Prophet (peace and blessings be upon him)), and he (peace and blessings be upon him) permitted them. Then this verse was revealed: "Their guidance is not your responsibility, but Allah guides whom He wills; and whatever good you spend, it is for your own benefit" up to His words: "and you will not be wronged."
Related hadith on this topic