Pain - physical or emotional - can be either experienced in one's own body and mind OR it can be experienced in form of helplessness that one feels when a loved one is undergoing pain.
Pain and Pleasure, like any other duality, are bound to happen at some point or other in our lives. A large part of our lives is not controllable by self - so both pain and pleasure may come unexpected, uninvited. While we are always excited to embrace any pleasure, we are almost always reluctant to embrace pain.
Both - pain and pleasure - are transient in nature, Hence, rejoicing in pleasure or whining in pain does not make sense.
I have so far found it easier to adopt this when the pain or pleasure, bodily or emotional, are directly experienced by myself. I find it more difficult to remain tranquil when another person is going through pain (not pleasure) and I can not do anything to alleviate it.
I am no one to inflict upon or alleviate any one's pain. So the matter is not about pain at all. It is about loving someone, but remaining cognizant that experiencing pain and pleasure are as much a part of that person's life (and growth?) as such experiences are part of my life.
Perhaps the trick is to break down the sense of narrow self, and enlarge it to include all beings and things. And apply the same thought as one applies to narrow self to everyone/everything else in the world.
Universal Love is the only path.