Visiting the graves is desirable for both men and women. This will remind us of the reality of death. The prophet (S.A.W) said to the companions, “I had (previously) forbidden you to visit the graves, now (it is permissible for you, so) go and visit them, there is a lesson to learn from them, and do not say anything that will upset Allah.” [Reported by Imams Al-Hakm, Al-Baihaqui, and Al-Bazzar]
Women just like men may visit the graves, because of the orders of the prophet (S.A.W), which included them too. Also women will share with men the same wisdom that can be learned from visiting the graves. And also when Aishah (R.A.) asked the prophet (S.A.W) what she could say when she visits the graves, the prophet taught her what she should say, and did not prevent her from visiting the graves. He said to her, “Say, Aishah, “Peace be upon the believing men and women dwelling here. May Allah grant mercy to those who have preceded us and those who are to follow them certainly, Allah willing, we will join you”. [Reported by Imams Muslim and An-Nasa’i]
The opinion for men as well as women to visit graves has been adopted by Imam Malik, some Hanafi scholars and even one report from Imam Ahmad. It is, however, important that the women must be dressed according to the Sharia’h rules and be accompanied by her Mahram.
Whoever pays a visit to a grave; you should face the deceased, greet and supplicate for him/her as the prophet used to do while he visited graves.