Prayer is a religious act, an attempt to communicate with a deity. Prayer can either be a predefined sequence of words, often poetic or set to music, or a spontaneous utterance of the praying persons' own thoughts.
Prayer was a common part of religious practice in the Bajoran religion. Individuals attainted from the Bajoran faith were not allowed to pray with other Bajorans. (DS9 novel: Avatar, Book Two)
The Ngultor had a prayer or mantra-like phrase, "Flesh of my flesh," which they chanted repetitively. (EV comic: "Flesh of My Flesh")
Prayer was practiced by followers of The Light. (TNG comic: "Light of the Day")