The Messenger of Allah ﷺ said, "When one of you feels pain, let him place his hand where he feels the pain and say, 'In the name of Allah, I seek refuge in the might of Allah and His power from the evil of what I find of this pain of mine.' Then let him lift his hand and repeat this an odd number of times."
أن رسول الله ﷺ قال: إذا اشتكى أحدكم فليضع يده حيث يشتكي، ثم يقول: بسم الله، أعوذ بعزة الله وقدرته من شر ما أجد من وجعي هذا، ثم يرفع يده ثم يعيد ذلك وترا.
Tirmidhi (3588) narrated it from Abdul-Warith bin Abdul-Samad, who said, my father narrated to me, who said, Muhammad bin Salim narrated to us, who said, Thabit Bunani narrated to us, from Anas bin Malik, and he related it. Tirmidhi said, "Hasan gharib from this angle, and this Muhammad bin Salim is a Basran shaykh." Hakim also narrated it from this angle (4/219) and graded it sahih. Tabarani narrated it in Al-Saghir (1/181) from Talib bin Murra Adhani, who said, Muhammad bin Isa Tabba narrated to us, who said, Muhammad bin Salim Basri narrated to us with his chain, similarly. He said, "No one narrated it from Thabit except Muhammad bin Salim Basri. Ibn Tabba alone transmitted it."I say, this is not as he claimed, for Abdul-Samad also narrated it from Muhammad bin Salim, as you can see, and its chain is hasan because of Muhammad bin Salim, who is acceptable, as Abu Hatim said, and Ibn Hibban mentioned him in Al-Thiqat (7/396).As for what has been narrated from Abu Umama as a raised hadith, "The completion of visiting a sick person is for one of you to place his hand on his forehead, or he said, on his hand, and ask him how he is, and the completion of your greetings among yourselves is the handshake," this is daif. Tirmidhi (2731) narrated it from Suwayd bin Nasr, who said, Abdullah informed us, who said, Yahya bin Ayub informed us, from Ubaydullah bin Zahr, from Ali bin Zayd, from Qasim Abu Abdul-Rahman, from Abu Umama, and he related it.Imam Ahmad (22236) narrated it from Khalaf bin Walid, from Ibn Mubarak, paired with Ali bin Ishaq, both of them from Yahya bin Ayub with his chain, similarly. Tirmidhi said, this chain is not strong. Muhammad said, "Ubaydullah bin Zahr is trustworthy, and Ali bin Zayd is daif, and Qasim bin Abdul-Rahman is known by the kunya Abu Abdul-Rahman, and he is trustworthy, and he is the freed slave of Abdul-Rahman bin Khalid bin Yazid bin Muawiya, and Qasim is Syrian." End of quote.As for Bukhari's statement that Ubaydullah bin Zahr is trustworthy, no one agreed with him on this, to the point that Ibn Hibban said of him, "He narrates fabricated reports from reliable narrators, so he is closer to being daif." As for Ali bin Zayd, who is Alhani, the scholars are unanimous in declaring him daif.