"And Pharaoh drew near" (Exodus 14:10) - he brought the punishment near to come upon himself. When Pharaoh saw that Israel were encamped by the sea, he said, "Baal-tzefon has agreed with the intent of my decree. I had thought to destroy them by water, and it has begun to destroy them by water." He began to slaughter offerings and burn incense and pour libations and bow down to his idol. Therefore it is said, "And Pharaoh drew near" - he drew near to slaughter and to burn incense.
Pharaoh Brought the Punishment Near and Sacrificed to Baal-tzefon
Yalkut Shimoni on Torah 230:18
(שמות יד י) וּפַרְעֹה הִקְרִיב, הוּא הִקְרִיב אֶת הַפֻּרְעָנוּת לָבֹא עָלָיו, כֵּיוָן שֶׁרָאָה פַּרְעֹה שֶׁיִּשְׂרָאֵל חוֹנִים עַל הַיָּם, אָמַר, בַּעַל צְפֹן הִסְכִּים עַל דַעַת גְּזֵרָתִי, אֲנִי חָשַׁבְתִּי לְאַבְּדָן בַּמַּיִם, וְהוּא הִתְחִיל לְאַבְּדָן בַּמַּיִם, הִתְחִיל מְזַבֵּחַ וּמְקַטֵּר וּמְנַסֵּךְ וּמִשְׁתַּחֲוֶה לַעֲבוֹדָה זָרָה שֶׁלּוֹ, לְכָךְ נֶאֱמַר וּפַרְעֹה הִקְרִיב, הִקְרִיב לִזְבֹּחַ וּלְקַטֵּר.