Christ taught in the Sermon on the Mount about prayer to help His disciples distinguish between legitimate prayer and false prayer.
And when thou prayest, thou shalt not be as the hypocrites are: for they love to pray standing in the synagogues and in the corners of the streets, that they may be seen of men. Verily I say unto you, They have their reward. But thou, when thou prayest, enter into thy closet, and when thou hast shut thy door, pray to thy Father which is in secret; and thy Father which seeth in secret shall reward thee openly.
Public prayer in which we all participate is acceptable, but prayer for show is not. Our prayers are for God's ears, not for the ears of others. I am nevertheless guilty of this very practice. When asked to offer a prayer in Sacrament meeting, I get nervous. I become overly concerned with how those in the meeting will perceive my prayer. I consider what words would be most beneficial for the congregation to hear from me. How foolish! If my prayer were sincere, I would not pray to the people, I would pray to God on their behalf. I am the spokesman, not the speaker. I ask forgiveness of those who have heard my public prayers and have praised my fine words but were robbed of the presence of the Spirit because of my pride.
Properly framed, our prayers are not to impress others. They lift us to God and invite him to work on our hearts. The reward we seek is not the praise of men but the peace of God. He rewards us openly as a witness of His goodness, not of our piety or worthiness.