"And the Egyptians pursued after them" (Exodus 14:9). Scripture tells that not one of them stumbled, lest they take it as an omen and turn back. And so we find that the gentiles practice divination, as it is said, "For these nations whom you are dispossessing listen to soothsayers and diviners" (Deuteronomy 18:14); and it says, "And the elders of Moab and the elders of Midian went with divinations in their hand" (Numbers 22:7). But here not one of them stumbled, lest they take it as an omen and turn back. "And they overtook them encamping by the sea, beside Pi-hahiroth, before Baal-zephon." When Pharaoh saw Baal-zephon, he rejoiced and said: Baal-zephon has agreed to my decree. I said to drown them in the water; Baal-zephon has agreed to my decree to drown them in the water. He began to slaughter and offer incense before his idol, as it is said, "before Baal-zephon, and Pharaoh drew near" [bringing offerings].
Egypt Overtakes Israel and Pharaoh Sacrifices to Baal-zephon
Mekhilta DeRabbi Shimon Ben Yochai 14:9
וירדפו מצרים אחריהם מגיד הכתוב שלא נכשל אחד מהן כדי שלא ינחשו ויחזרו לאחוריהן וכן מצינו שהגוים מנחשין שנאמר (דברים י"ח י"ד) כי הגוים האלה אשר אתה יורש אותם אל מעוננים ואל קוסמים ישמעו ואומר (במדבר כ"ב ז') וילכו זקני מואב וזקני מדין וקסמים בידם אבל כאן לא נכשל אחר מהן כדי שלא ינחשו ויחזרו לאחוריהן: וישיגו אותם חונים על הים לפני בעל צפון. כיון שראה פרעה את בעל צפון שמח ואמר הסכים בעל צפון לגזירתי אני אמרתי לטבען במים הסכים בעל צפון לגזירתי לטבעם במים התחיל מזבח ומקטר לפני ע"ז שלו שנאמר לפני בעל צפון ופרעה הקריב: