To me, "parted ways" sounds like a mutually-agreed separation.
I'm not sure what's better, maybe "sorry to hear we won't be working together anymore" but really, unless they were a pretty close friend I probably would not say anything. It just comes across as "sucks for you" while not-so-subtly drawing attention to the fact that I still have a job.