Ray didn't know what came over him... Was it the mood, or the strange empathy he felt toward Leilah, Or simply was it because he'd seen himself in her somehow? Either way, he'd acted so out of character that even he didn't know what really drove him to do what he did.
He could clearly see Leilah's suffering, her struggles to come to terms with the loss of her sister, and how she was fighting to keep her composure in front of them and that was something that drew him to support her. So he simply stood by her side and held her shoulder when he thought that she was going to lurch forward toward the coffin when they started lowering it into the ground.
But, when he could clearly see her shutting away her surroundings and starting to numb everything around her, he didn't even stop to consider his actions. He simply asked his father to take care of Hunter and leave him with her.