du'a for the deceased for Allah's mercy and reward
calling them to maintain acceptance (ridhaa) toward Allah's decree
The other should answer with something like, "May Allah answer your du'a and have mercy on us and you."
There is nothing wrong with crying over the deceased.
What is forbidden is an-nadb which means crying while listing the good qualities of the deceased
And an-niyaaha which means wailing and raising one's voice with the above
Also forbidden is tearing one's clothing, hitting one's own face, wailing or screaming, pulling one's own hair, hitting one's chest or invoking and "call of jahiliya" (which means any tribal, racial or national meanings).
Visiting the grave is sunnah for men.
And it is disliked (makrooh) for women (in one of two opinions of Ahmad and others)
If a woman passes by a grave on her way, it is definitely a good thing for her to give salaams and make du'a for the deceased (the content of a "visit", it is a good thing (hassan).
Sunnah for one who visits a grave or passes by one to say the following (or other similar narrations):
السَّلَامُ عَلَى أَهْلِ الدِّيَارِ مِنْ الْمُؤْمِنِينَ وَالْمُسْلِمِينَ وَيَرْحَمُ اللَّهُ الْمُسْتَقْدِمِينَ مِنَّا وَالْمُسْتَأْخِرِينَ وَإِنَّا إِنْ شَاءَ اللَّهُ بِكُمْ لَلَاحِقُونَ Muslim
Similarly, responding to one who sneezes and says (الحمد لله) with (يرحمك الله) is fardh kifaya and some said fardh 'ain.
The deceased suffers when innovations are committed at his grave (this is shown to him)
The scholars differed about whether the deceased is aware of visitors to his grave and whether he hears them and sees them. The correct answer is that he does not. This is 'ilm al-ghaib (unseen knowledge) and there is no sound daleel which supports this belief. Pay attention to this point and remember that most excess in deen begins with excess with regard to the graves of the righteous.