Prayer in Buddhism is a bit different - it is more of a statement of intent or a wish formally expressed than a petition to something outside ones self (who/what "hears"?).
The purpose is found in the Buddhist concept of karma - that every thought, word or action an individual makes has consequences; that a prayer, especially for relief of another's suffering, makes positive consequences both in my life and in the cosmos as a whole.
One of our daily prayers begins with:
With reverence, we offer the merits we have accumulated through [our daily practice] so that everywhere under the heavens may equally become a tranquil land and may all the people in those lands enjoy happy lives.
Another ends with:
With this prayer, we endeavor to increase our understanding and appreciation of what others have given and contributed to us, and to develop constant, mindful consideration of how our thoughts and actions will beneficially contribute to others.
Hopefully this illustrates that these are more statements of intent, or formal expressions of wishes than they are prayers to some external force or entity for answers.