<human>: This friend will occasionally come to me when he's done badly on a test. School's been rough for him lately. He also is terrible at getting the motivation to study. The implications of him failing his recent classes are pretty severe (not finishing undergrad on time, etc.) and I can tell it's something that bothers him deeply. There's a bit more to the whole thing, but I realize it isn't my responsibility to help him with all of that, other than offering to studybuddy up with him. 

I just want to know what would be the best thing to say to him right when it happens. Things like "I'm really sorry to hear that" seem to just piss him off more.

Can you condense the text into three sentences or less?
<bot>: What are some one-liner type things I can say to help make my friend feel better when he does poorly on a test.