One day a group of Jews came to His Eminence (S), asked him many questions and argued with him. His Eminence (S) answered them from their books. Finally they said: O Muhammad, if you are a prophet, show us a miracle like that of the staff of Musa. The Prophet said: The book I have brought to you is better than the staff of Musa (a.s.) because it will remain even after me, till the hereafter, and confront the enemies and none will be able to bring even a verse like it.
Whereas the staff of Musa (a.s.) is no more and no one can test it anymore. While the Qur’an will remain forever and be tested all the time. Still, let me show you a miracle greater and stranger than that of the staff of Musa (a.s.). The Jews said: Show us. His Eminence (S) said: Musa (a.s.) used to hold the staff in his hand and infidels alleged that Musa is doing something in his staff that it performs such tricks.
Now Allah will turn sticks into serpents even though I have not touched them and I am not present there. When you go back home and gather in a room at night, Allah will turn each of the roof beams into a serpent. And there are more than a hundred beams in that room. Seeing this, four of you will die and others will be unconscious till morning next.
Then many other Jews will come to you and you will tell them all about the incident, but they will not believe you. After that, the beams will again turn into serpents as the night before. Seeing this, many will die, many go mad and many will faint. Imam (a.s.) says: By the One Who sent Muhammad as a true prophet, the Jews began to laugh aloud without any respect for the Holy Prophet (S) and without any fear.
They said to each other: See what claim he has made, exceeding all limits! His Eminence (a.s.) said: You may laugh now, but you will have to cry very soon and become perplexed. Listen, whoever falls in this miserable condition and is afraid of death or madness, he should pray as follows: O Allah, for the sake of Muhammad Mustafa (S) and Ali Murtaza (a.s.) and their successors, that whosoever leaves their affairs to them is chosen and liked by You, give me the strength to see this incident.
And if one has a friend from among the dead and one wants him to come to life again, he must pray to Allah in the same way. Allah will make him alive and give him strength. They went and gathered there and started laughing on the Prophet’s words that beams will turn into serpents etc. Suddenly they heard the roof make a move and all of a sudden the beams turned into serpents that hung their heads on the wall and made a move to swallow them.
First they swallowed the pots, vessels, stones, chairs, the door posts of wood and doors. They swallowed all this and what His Eminence (S) had said came true. Four people died, some became mad and many feared for their lives and prayed to Allah as the Prophet had advised and their hearts became strong. Then some of them prayed for the four dead people and they came back to life. When they saw this, they said: Our prayer is accepted and Muhammad is a true Prophet, but we find it difficult to testify and obey.
That is why, it is better to pray as above so that our hearts become soft to testify and obey. At last they prayed. Allah made their faith strong, purified their hearts and removed wickedness from their hearts. They believed in Allah and His Messenger (S). In the morning, when Jews arrived, the beams again turned into serpents like the previous night. Seeing this, they became perplexed and they were overpowered by wickedness.
Reference:Hayat Al-Qulub Vol. 2