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) said: "Do not pray facing towards a grave, nor on top of a grave."
Hadith Referenceسلسله احاديث صحيحه / الاذان و الصلاة / 808