This happened to me quite recently actually and I was pleased to finally find what works best for me and leaves me with no emotional reaction.
I used to always say hello to current/ex Ts partly because I wanted to and also because it seemed rude not to. Deciding whether to do this or not always left me fraught with anxiety though. After noticing a T approaching, I would have to look for any sign of acknowledgement that they had noticed me, and any subtle signals I could gather from their body language and facial expressions that suggested it was OK to say hello. I don't think I could ever tell. However on two occasions, each with a different T, I decided to take the plunge and just say hello anyway but ended up feeling hurt and rejected by their obvious unwillingness to say an extremely awkward 'hi' in reply. If they had told me at some point that if we were to meet in public, not to expect much acknowledgement, then fine, but the point is they didn't so I had no idea of what therapists normally do in these kind of situations (i.e. pretend not to know the client, engage in a very minimal exchange etc.) Until visiting forums such as this and finding out it's a "therapist thing", I took it personally and as an indication that my therapeutic relationships hadn't been genuine and the Ts actually disliked me, or I had at some point done something wrong either in therapy or by saying hello. As a result, not only did I feel hurt, I also felt powerless. When I saw an old T in public more recently, I therefore decided to do something different and it turned out to be the best way for me!
I had somewhere to be and as I was briskly walking, I noticed a face in the crowd that I recognized and my brain registered that it was T. It was only for that one second that I happened to be looking in her direction and she was looking elsewhere so my hope was that she didn't notice me. In a flash, I averted my eyes to the road to look where I was walking and just kept on at speed. I didn't look back.
To my relief, I felt nothing as I had done the previous times of seeing a T in public, only joy that at last, I had found a way of managing these encounters that left me feeling calm, confident and in control, rather than hurt, rejected, weak and foolish.
So that's how I cope.