סימן ס סעיף יא
הָרוֹאֶה קִבְרֵי יִשְֹרָאֵל, מְבָרֵךְ, בָּרוּךְ אַתָּה ה' אֱלֹקֵינוּ מֶלֶךְ הָעוֹלָם, אֲשֶׁר יָצַר אֶתְכֶם בַּדִּין וְכוּ', וְעַל קִבְרֵי עוֹבְדֵי כוֹכָבִים אוֹמֵר, בּושָׁה אִמְּכֶם מְאֹד, חָפְרָה יוֹלַדְתָּכֶם, הִנֵּה אַחֲרִית גּוֹיִם מִדְבַּר צִיָּה וַעֲרָבָה (ירמיהו נ יב).
When you see graves of Jews, you should say: Baruch ata Adonoy Elokeinu melech ha'olam asheryatzar eschem badin … [Blessed are You, Hashem, King of the universe, Who has formed you in judgment etc.] When you see the graves of pagans, you say: [the verse in Jeremiah 50:12] "Your mother will be deeply ashamed, she that gave birth to you will be disgraced. Behold, the ultimate end of nations will be a desert, a dry land, and a wilderness."
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)