All perfect praise be to Allah, The Lord of The Worlds, and may His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
It is recommended for the person who sneezes during prayer to say 'Alhamdulillah'. Nevertheless, saying that on purpose while reciting Al-Fatihah breaks its incessancy and so re-reciting it becomes an obligation. Moreover, it is better to delay saying 'Alhamdulillah' until after finishing Al-Fatihah. An-Nawawi(May Allah have mercy on him) said, " While reciting Surat Al-Fatihah, if the praying person said 'Alhamdulillah' or sneezed and said 'Alhamdulillah', the incessancy of this Surat is broken and so he/she is obliged to re-recite it."{Al-Majmou`, 3/359}.
However, it isn`t permitted for a praying person to say 'Yarhamukallaah' to a sneezer. "It is permitted for a praying person to make Du`aa`, as long as the addressee is non-other than the Messenger of Allah(PBUH). If he said to someone, 'may Allah forgive you' (Ghafar allaahul aka), 'may Allah be pleased with you' (Radi allaahu anka) or 'may Allah bless you with recovery' (Shafakhallaah), then his prayer is invalidated.
This is based on the Hadith of Mu`aawiyah Ibn Al-Hakam. If the praying person greeted someone with 'Asalamualikum' or was greeted by someone and replied by saying 'Wa`alikassalaam' or said to a sneezer 'Rahimakahallaah or Yarhamukallaah', then his prayer is invalidated……….
However, if he returned the greeting by saying 'Wa`alihiassalaam' and said to a sneezer 'Yarhamuhoallaah', then his prayer isn`t invalidated according to the consensus of the fellow scholars because it is a pure Du`aa`."{Al-Majmou`, 4/84}. And Allah knows best.