Sayyiduna Abu Hurayrah (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) "has cursed the women who visit graves."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7204
Abd al-Rahman bin Hassan narrates from his father (may Allah be pleased with him): "The Messenger of Allah (peace and blessings be upon him) has cursed the women who visit graves."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7205
It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) "has cursed the women who visit graves, and those who establish mosques over them, and those who light lamps (on them) as well."
This is the wording of Shu'bah's hadith, and in their two narrations it is: "the women who frequently visit graves, those who build mosques over them, and those who light lamps."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7206