"And the LORD appeared to him." You find that the Torah's beginning is lovingkindness, its middle is lovingkindness, and its end is lovingkindness. Its beginning is lovingkindness, for the Holy One, blessed be He, adorned Eve and brought her to Adam, as it is said, "And the LORD God built the rib" (Genesis 2:22) — for in the coastal cities they call the braiding of hair "building." [And its end is lovingkindness, for He buried the dead, as it is said, "And He buried him in the valley" (Deuteronomy 34:6).] In its middle is lovingkindness, for He visited the sick, as it is said, "And the LORD appeared to him" — because Abraham was ill from the circumcision, therefore the Holy One, blessed be He, appeared to him; and it was the third day, when Abraham was in great pain. "By the oaks of Mamre." Because Mamre had told Abraham that he should heed the Holy One, blessed be He, and circumcise himself, therefore He appeared at his oaks. "And he was sitting at the door of the tent." When Abraham saw that no passersby were coming to his house, because they knew that he was ill, therefore he sat at the door of the tent, so that he might see travelers and bring them into his house. "In the heat of the day." From here we learn that warmth is good for circumcision. Another interpretation of "in the heat of the day": it was midday. Another interpretation: the Holy One, blessed be He, made that day burn and seethe with heat so that travelers would not pass by, so that Abraham would not be troubled; and when Abraham saw this, he sat at the door of the tent so that he might bring them into his house. Another interpretation: Abraham went to Aner and said to him, "Thus said the Holy One, blessed be He, to me: cut off your foreskin. What do you advise me?" Aner said to Abraham, "Do not cut off your foreskin; if this command were good, why did He not command it to Noah, whom He called righteous and blameless?" He went to Eshcol, and he too answered likewise; he said to him, "He spoke rightly." Abraham left their words and went to Mamre, and said to him, "What do you say to me? For the LORD has spoken to me: cut off your foreskin." Mamre said to him, "Is He not the LORD by His name, who brought you out of Ur of the Chaldees? Go and accept His words, for if He should say to you, 'Make yourself piece by piece,' do it — and you are afraid of your foreskin?" At once Abraham went and circumcised the flesh of his foreskin; therefore it is said, "as God had commanded him."
Why the Lord Appeared to Abraham at the Oaks of Mamre
Midrash Aggadah, Genesis 18:1
וירא אליו ה'. אתה מוצא בתורה תחלתה חסד ואמצעיתה חסד וסופה חסד. תחלתה חסד שקישט הקב"ה את חוה והביאה אל האדם, שנא' ויבן ה' אלהים את הצלע (בראשית ב כב), שכן קוראין בכרכי הים לקלעייתא בנייתא. [ובסופה חסד שקיבר את המת, שנאמר ויקבר אותו בגי (דברים לד ו)] באמצעיתא חסד ביקר את החולה, שנאמר וירא אליו ה', לפי שאברהם היה חולה מן המילה, לכך נראה אליו הקב"ה, ויום שלישי היה שהיה אברהם כואב מאד: באלני ממרא. לפי שממרא אמר לאברהם כדי שישמע להקב"ה שימול, לכך נראה באלוני שלו: והוא יושב פתח האהל. כשראה אברהם שלא היו עוברים ושבים בביתו, מפני שהיו יודעים בו שהיה חולה, לכך יושב פתח האוהל, כדי שיראה אורחים ויכניסם לביתו: כחם היום. מכאן שחמימות יפה למילה: ד"א כחם היום. חצי היום היה: ד"א הקדיח והרתיח הקב"ה אותו יום בחום כדי שלא יהיו האורחים עוברים כדי שלא יצטער, וכיון שראה אברהם כן ישב לו פתח האהל כדי שיכניס אותם לביתו: ד"א הלך אברהם אצל ענר ואמר לו כך אמר לי הקב"ה תכרית את ערלתך, אתה מה תיעצני, אמר ענר לאברהם אל תכרות ערלתך, אם היה הצווי הזה טוב, למה לא צוה לנח כי צדיק ותם קרא אותו, הלך אצל אשכול גם הוא השיב כן, אמר לו בצדק דבר כך. עזב אברהם דבריהם והלך אצל ממרא, ואמר לו מה תאמר לי, כי ה' דיבר לי כרות ערלתך, אמר לו ממרא הלא הוא ה' שמו אשר הוצאתיך מאור כשדים, לך וקבל דבריו, שאם יאמר לך עשה עצמך חתיכה חתיכה עש, ובערלתך אתה תפחד, מיד הלך אברהם וימל את בשר ערלתו, לכך נאמר כאשר צוה אתו אלהים: