A Hasidic tale set in the time of the Baal Shem Tov describes two harmful spirits that frightened women in a synagogue's women's section so badly that they stopped praying there. The story, told by Rabbi Yitzchak Yishai Ben Nun, says the Maggid of Mezeritch, Rabbi Chaim, drove the spirits out through Torah study, but they then harmed his two children.
After seeing his sons' condition, Rabbi Chaim urgently asked the Baal Shem Tov to come and heal them. The Baal Shem Tov arrived with his assistant, Rabbi Tzvi, and had the two sick boys brought into the same room where he was staying for secluded meditation. Before they fell asleep, the two spirits appeared at the doorway and mocked him.
According to the story, the spirits put their heads under the Baal Shem Tov's pillow, then moved toward the children. He rose, rebuked them, and asked where they were going. They answered insolently, sang "Lecha Dodi" in his own melody, and continued taunting him. The Baal Shem Tov acted, and the spirits suddenly fell to the ground and could not get up. They pleaded with him, and he told them the children would soon recover.
The spirits then explained that one boy had already been badly harmed internally and could not be fully repaired, but they had come to cause further damage. They also revealed, in the story, that they were created because the synagogue cantor sang with vanity and improper intentions, trying to impress the women, while the women also had improper thoughts about him. The two spirits said one was male and one female, and that was why they had come to the synagogue. The Baal Shem Tov finally placed them near a pit in an uninhabited area, removing them from the synagogue and saving the children.