Jabir reported Allah's Messenger (ﷺ) prohibited invocation. Then the people of Amr b. Hazm came to Allah's Messenger (ﷺ) and said: We know an invocation which we use for curing the sting of the scorpion but you have prohibited it. They recited (the words of invocation) before him, whereupon he said: I do not see any harm (in it), so he who amongst you is competent to do good to his brother should do that.
Source: sunnah.com
Other translations
Arabic
حَدَّثَنَا أَبُو كُرَيْبٍ، حَدَّثَنَا أَبُو مُعَاوِيَةَ، حَدَّثَنَا الأَعْمَشُ، عَنْ أَبِي سُفْيَانَ، عَنْ جَابِرٍ، قَالَ نَهَى رَسُولُ اللَّهِ صلى الله عليه وسلم عَنِ الرُّقَى فَجَاءَ آلُ عَمْرِو بْنِ حَزْمٍ إِلَى رَسُولِ اللَّهِ صلى الله عليه وسلم فَقَالُوا يَا رَسُولَ اللَّهِ إِنَّهُ كَانَتْ عِنْدَنَا رُقْيَةٌ نَرْقِي بِهَا مِنَ الْعَقْرَبِ وَإِنَّكَ نَهَيْتَ عَنِ الرُّقَى . قَالَ فَعَرَضُوهَا عَلَيْهِ . فَقَالَ " مَا أَرَى بَأْسًا مَنِ اسْتَطَاعَ مِنْكُمْ أَنْ يَنْفَعَ أَخَاهُ فَلْيَنْفَعْهُ " .
sunnah.com