The best thing to say to a grieving person is “I am sorry for your loss”. But there are many things to say to someone who lost someone to show your sympathy. Another example is “I am always here when you need me”.