Surah Al-'Ankabut — Ayah 65 (29:65)
فَإِذَا رَكِبُواْ فِي ٱلۡفُلۡكِ دَعَوُاْ ٱللَّهَ مُخۡلِصِينَ لَهُ ٱلدِّينَ فَلَمَّا نَجَّىٰهُمۡ إِلَى ٱلۡبَرِّ إِذَا هُمۡ يُشۡرِكُونَ ٦٥
English translation (Saheeh International)
And when they board a ship, they supplicate Allāh, sincere to Him in religion [i.e., faith and hope]. But when He delivers them to the land, at once they associate others with Him
Brief commentary
When the idolaters board ships and sail the ocean, they call out to Allah alone, sincerely supplicating to Him to save them from drowning. After Allah saves them from drowning, they return to their idolatry, calling out to their idols together with Him.