"Wow, that sucks. How are you holding up? Let me know if I can help, like with practice questions or whatever. If you've got time this weekend we can grab lunch."
It's not perfect, but you can go a long way with something like the above: unqualified acknowledgement, interest in their well-being, offer of support with an example, and a non-pushy offer to have some company/fun/distraction. Swap in specific phrasing as you'd like.