It depends on what your relationship with them, and their position in job hunting.
If it is your co-worker, they got laid off and you didn't. It is awkward. I would just say the normal thing that you would say to people who left their job like moments you cherished with them and things you learned from them, and that you are sorry to see what happened to them. if you think they don't have a problem finding another job, I won't even say the last bit of being sorry, just say it sucks what happened.
I really hate fake sympathy.