Remembering my teenage times, statements like
"Things like this happen"
aren't helping you feel less sad. Of course most teenagers cognitively know that relationships can break apart, and by telling them this they feel talked down to. They know that, but that doesn't make them feel better.
If someone is grieving over something else, would it be a good idea to tell them "things like this happen" or "don't worry about it"? I don't think anyone would feel taken seriously if you said something like that.
This might feel like one of the worst moments of the teenagers life to them and by saying things like that, you'll seem like you're trying to take the (subjective) gravitas of the situation away. Teenagers are somewhere between childhood and adulthood, and by just "waving their problems away" this matter, you are effectively treating them like children again.
What is the proper way to respond in this situation?
The proper way is to take them seriously.
They probably feel completely and utterly lost now, so be a bit careful on how you word things. Maybe tell them that you yourself felt like this at one point. Make them feel understood, make them believe you that almost everybody went through this at one point, but they all made it in the end.
I think it also heavily depends on your child and your relationship to them. I'll bet there are some parents out there who could cheer up their teenage children with some slightly cynical jokes. Some others might just be there and listen. Again others might do some activity to take their childs' mind off of the ex-partner.
It all depends on who they are as a person and how your relationship is. Just don't ignore it or hand-wave it away and you'll probably do fine, because you know your kids :)