It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Prophet (peace and blessings be upon him) cursed the women who visit graves, and those who build mosques over them and those who light lamps (on them).
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 12671