For people of faith, prayer is taking a moment to aim themselves at the highest possible ideal and to orient their lives toward the greatest and most universal possible good that they can imagine and to personally commit their daily lives to that end.
Prayer is a moment to be grateful for all the good in their lives and to remember it even in the darkest times; it is a moment to consider and examine their own individual shortcomings– how they personally have contributed to making the world worse in any way, or failed to make it better when they could have; a moment to humble themselves and to forgive the world its trespasses, letting go of any grudges or resentments they have against others.
That's what people of faith mean when they say they are offering their thoughts and prayers to the families of terrible tragedies. And that is not empty, or pointless, or even the least they can do. They are actually offering to do the most they can– they are dedicating their entire lives to making a better world.
Beautifully articulated, and I think, very accurate. May your thinking, as well as the "prayers" themselves, continue to spread and compound...