It is narrated from Sayyiduna Abu Marthad (may Allah be pleased with him) that he heard the Prophet (peace and blessings of Allah be upon him) say: "Do not pray facing towards graves, nor sit on them."