According to the Midrashim quoted by Rashi, Yitzchak was born precisely a year after the angels visited Avraham and Sarah, on the first day of Pesach. (According to the gemara Rosh HaShanah 11a the angels visited on Sukkos.) Rashi (21:2) writes that HaShem gave Avraham a sign. On the day the angels visited, HaShem made an etching in a wall and told Avraham, "When the sun reaches this point again next year, you will have a son." This sign requires some clarification. How exactly did this work?
An object that is standing upright in the path of the sun will form a shadow on the ground. The exact direction of the shadow depends on the position of the sun in the sky. As the sun moves through the eastern sky in the first half of the day, the shadow will be pointing westward and vice versa for the second half of the day. However, the exact direction of the shadow, i.e., its northerly or southerly bearing, will constantly change. As well, the size of the shadow is dependent on the north/south position of the sun as well. These are the principals behind the sundial. All of the factors change throughout the day and the daily patterns change throughout the year as a result of the change in direction of the earth's tilt. However, one thing is certain. At midday, the sun is not in the eastern sky or the western sky. Rather, it is either due north or due south, depending on where you are in the world. What is relevant to us is that since Eretz Yisroel, at approximately 31o North, is above the Tropic of Cancer (23.5o North), the sun will always be in the southern sky at midday. The size of the shadow depends on the angle of the sun in the sky which depends directly on the time of year.
Any sign involving a shadow would surely have been simplest to arrange at midday. It is therefore most noteworthy that the gemara (.ברכות כ"ז) infers from the words (18:2) "kechom hayom," in the heat of the day, that the angels visited in the sixth hour. After the food was prepared and served and the angels conversed with Avraham, it seems altogether plausible that it was exactly midday. It seems that the sign that was given was that at that moment, the southern wall (or other standing object) was casting a shadow on the northern wall. The scratch that was made on the wall indicated the end of the shadow. When the shadow reached the exact same point at midday sometime in the next year, it would indicate that a complete year had passed.
With all this considered the Midrash is quite troubling. All these details are specific to the solar year. However, Yitzchak was born precisely one year later by the lunar calendar, not the solar calendar. What significance could any sun-related sign have to the passing of a lunar year?
I particularly enjoyed the answer that Pi offered in the comments:On pasuk 18:10, Seforno says: שוב אשוב אליך - למועד המילה כפעם בפעם. This suggests that the time the angels would return a (solar) year later was not the exact day of Yitzchak's birth, but rather some time later. The book קונטרס די שמיא by Alexander Shutz on pages 18-19 claims that the ריב"א asks your question, and that ר' צבי יודא פריידמאן suggests the following answer: The angel Rephael would come back three days after Yitzchak's bris mila to heal him, which would be (about) 11 days after his birth, so that could have been the occasion when the sun reached the line that was marked on the wall.