Quoted from Time magazine article by Rabbi David Wolpe:
We offer prayers to elevate ourselves along with the one who has suffered. If our prayers are truly with them, we are committing ourselves to work toward a world in which such tragedies—whether mass shootings or diseases or natural disasters—can be mitigated or ended. A prayer changes the world through changing us. It moves us to action. Praying pulls us closer to God and therefore toward what might be—what should be.
Seen in this light, a prayer is no limp bouquet of empathy tossed across the country but a sturdy rope of solidarity thrown to the sufferer, one that acknowledges that we are in this together, and they are hurting because we—all of us—have not yet done enough to help.
In a free society when something terrible occurs, as Abraham Joshua Heschel taught, few are guilty, but all are responsible. A prayer offered with such consciousness says: “I am with you. I might have done more. Your pain is not separate from my deeds and my life. I pray that you will have comfort, and that I, along with others who know of your suffering, will work to make a world in which such pain is banished.” That is how our hopes of healing will come to pass.
See the full article: http://time.com/4375076/orlando-shooting-prayer/