The motif Prayer is a part of: Ritual
Faith, speech, words, ritual
Prayers in a religious sense of the word, are adressed to one or more gods, divine or sacred persons in anticipation of help, blessings or a good relationship.
There are prescribed prayers, e.g. the Lord's Prayer and Ave Maria, and there are prayers, which are spontaneous and individual. Both kinds are present in Andersen's tales.
A long time had passed; the Bottle stood empty in a corner, and it did not know whether it was on the voyage out or bound for home, for it hadn't been ashore. Then a mighty storm arose. Huge, heavy, black waves rose up and hurled the vessel about. The mast crashed overboard; a mighty wave smashed in a plank, and the pumps were useless. The ship was sinking, but in the last minute the young officer wrote on a piece of paper, "Lord Jesus have mercy on us – we perish!" He wrote his fiancée's name, his own, and that of the ship, put the note into an empty bottle he found near by, pressed the cork in tightly, and then flung the bottle out into the stormy sea.