I can understand how this would be upsetting you. It seems things were said in the heat of the moment...these things happen.

I would probably wait a week or so and then send a text and say something along the lines of 'im so sorry fr your loss and im very sorry for our last conversation.

Try not to beat yourself up too much.