Some variation of using the word "condolences" is my go to, or offering sympathy. I generally hate using the word sorry in a situation where atonement isn't the goal. I understand it's just something we do, but it's weird, it's almost like saying "hey, I would like to make up and admit I did something wrong in this person you love dying"