So, what should you say to someone who is in chronic pain? The best thing, for me, is to sincerely ask how I am doing, as opposed to an obligatory "how are you?". The most meaningful and encouraging thing to me is to hear that you care, and to show me that by saying, "I'm sorry you are in pain", or "I'm sorry you're living with this", or "I am thinking about you", or "I will be praying for you and God's healing".
I don't remember a lot of things, thanks to the side effect of one of my migraine drugs, but one memory I do have is of my thoughtful brother-in-law reaching out to me, embracing me in a hug, and genuinely saying, "I'm sorry you're having such bad headaches", at a random moment at a social event. That moment still brings tears to my eyes.
A hug always does a heart good anyway, doesn't it?