I know you have wondered what to say in times that you have felt you should offer condolences. Many grieving people have said that we no not need to "say" anything because just our presence conveys comfort. All we need to do is just be there.
In my experience with funerals, the most beloved Scripture is Psalm 23. We will also hear this Scripture read in many grave-site scenes of old Western movies. Here is the King James Version of this Psalm:
The Lord is my shepherd; I shall not want. He maketh me to lie down in green pastures: he leadeth me beside the still waters. He restoreth my soul: he leadeth me in the paths of righteousness for his name's sake.
Yea, though I walk through the valley of the shadow of death, I will fear no evil: for thou art with me; thy rod and thy staff they comfort me. Thou preparest a table before me in the presence of mine enemies: thou anointest my head with oil; my cup runneth over. Surely goodness and mercy shall follow me all the days of my life: and I will dwell in the house of the Lord forever.
King David wrote this Psalm and filled it with blessing from the Lord. We may ask how he could feel so blessed when he had suffered greatly at the hands of King Saul who had made him a fugitive. Saul pursued him and tried to kill him several times. So when David says that he has walked "through the valley of the shadow of death," he isn't just using figurative language.
David also gives us a shepherd to watch over us, to give us rest in "green pastures," representing food and water. This shepherd also restores our souls. How often are we running on empty and our souls cry out for some nourishment? Sometimes that hunger is difficult to identify, and we look to appease it with other things such as food, drink, TV, music, video games, daydreaming, etc.
In the next part, we are given comfort through the difficult times, even times as disastrous as death. Then this wonderful shepherd prepares a table for us in the presence of our enemies. Have you experienced some type of recognition or praise in the presence of someone who has hurt or wronged you? Then the shepherd anoints our heads with oil until our cups run over. That anointing is spiritual, a blessing of fulfillment, of love, of joy, of peace. Nothing tangible may have changed, but inside we have been at the Master's table.
Goodness and mercy will follow us all the days of our lives, and we will eventually dwell in the House of the Lord forever. What a promise! Someday, I want to sit in the presence of Jesus, the Shepherd, along with David who has blessed us with this wonderful Psalm. That dwelling with the Shepherd is yet to come for us, but it is surely a promise that we can count on.