“thoughts and prayers”
These words of condolence and consolation have in recent times been scoffed at for their inability to bring back those who have died or stop similar events from happening in the future. In this life, grief is a reality we cannot avoid. Events out of our control happen more often than we wish, seriously altering the course of our lives. But when they are in our control – or at least should have been in our control – we turn from "thoughts and prayers" to figuring out some foolproof method for it to never happen again.
Such is foolishness for two reasons. First, it is impossible to completely avoid accidents (that is the very definition of an accident) unless we were to lock ourselves in a cell; but nevertheless, death still comes for us. Second, we do a great injustice to the people grieving.
When Paul exhorts Christians to "weep with those who weep" (Rom 12:15b), the picture he most likely has in mind is Job's friends when they first come to Job.
Now when Job's three friends heard of all this evil that had come upon him, they came each from his own place, Eliphaz the Temanite, Bildad the Shuhite, and Zophar the Naamathite. They made an appointment together to come to show him sympathy and comfort him. And when they saw him from a distance, they did not recognize him. And they raised their voices and wept, and they tore their robes and sprinkled dust on their heads toward heaven. And they sat with him on the ground seven days and seven nights, and no one spoke a word to him, for they saw that his suffering was very great. (Job 2:11-13)
The bad reputation espoused to Job's friends comes from their actions following this passage. Here, however, we see that they intended to help Job in his grief, at least it was what they set out to do. In their actions, we see what it means to weep with those who weep.
No Words Are Necessary
"They sat with him on the ground. . . . and no one spoke a word to him." Job did not need counsel, words of encouragement, or anything other than to know someone was there for him. Grief has a way of disorienting a person so that their perception of reality is skewed. It is similar to walking a straight line while intoxicated. When someone sober guides you, walks beside you, and is with you, there is a better chance of you getting to the other side unharmed.
When you "weep with those who weep," you do not have time to say anything because you are too busy weeping. That is the point Paul is making. We walk with those grieving in such a way as to show them we care about them where they are, not where we think they should be. We walk with them in such a way as to forget ourselves to serve them.
Words are unnecessary for the grieving because they won’t make much sense. Grief stuns so as to block everything out of the mind. Words don't stick for the grieving.
Hurting by 'Helping'
Seeking some proactive way to prevent similar events from happening might help others, but it doesn't help the one grieving. In fact, it does more damage. Their grief is both forgotten and used as a platform to stand a plan for action upon. In both cases, it overlooks the sufferer's grief. Grief does not go away with an improved plan to prevent certain events. It takes time to heal, and so patience is the virtue needed to help, not charisma to bolster activism.
Grief also doesn't go away with 'fixing' the person. Job's friends thought Job was at fault, and that God had done this because Job sinned. Their accusations sent Job further into despair, for he could not find the sin responsible for it. We are told at the beginning that Job was righteous and upright and that this trial was not on account of his sin. However, he wasn’t informed.
Even if the trial came about because of sin, his repentance would not have taken away the fact that his children and possessions were gone. The help from his friends turned out to be no help at all.
Grief for a Reason
The reason we let grief take its natural course is that there is a reason for grief. When trials come, biblically-minded Christians understand that they come by the hand of God. In His wisdom and power, God designs and works whatsoever comes to pass in our lives for His purpose. Therefore, everything in life has purpose and meaning.
For the unbeliever, grief is an obstacle to overcome. While it may cause a change in perspective for the better, those who live without regard for God would rather not have to go through it. Why? Because this life is all there is to them, and so anything hindering life being 'lived to the fullest' must be avoided.
What is the purpose of grief for the Christian? It is always ultimately to be conformed into the image of Christ. We live for the next world, not this one, and so we embrace everything – the ups and downs – knowing that nothing is ultimate here. When we receive good, our praise to God for His mercy and goodness increases; when we receive bad, our hope in God for heaven increases. Either way, we are drawn to God by whatever comes our way, be it joy, or be it grief and sorrow.
Grief Fades Away
There is a time when grief fades. The events that took place are still clear, and the loss (or whatever it may be) still stares us in the face. But the grief is gone. Maybe it is that we just become accustomed to the pain of grief, or that it actually does go away. Regardless, the constant sting fades. It fades over time, and reality becomes clear again making us able to learn from what we have just gone through.
It is the patience of others who weep with us that helps significantly.
So when we hear "thoughts and prayers" directed towards someone grieving, let us remember that they are the most helpful and most needed at that time. They signify, "weeping with those who weep;” there is no counsel involved and no 'help' brought. Thoughts and prayers are simply us sitting with them on the ground in silence.
 It is good, nevertheless, to do everything in our power to avoid accidents and grievous events, but it shouldn’t be our primary focus when dealing with grief.
 I should note that suffering can and does come to us because of sin. Job's friends were not wrong to ask if sin was the cause, but their fault was their short-sightedness, for they did not know any other reason for suffering. Suffering happens for all kinds of reasons, most of which we do not understand until sometime after the grieving process.