The card can be addressed to the deceased or more commonly, the bereaving family.
Write something short and thoughtful, fitting for a last farewell. Express how sorry you feel for the passing, your memory of the deceased and your support for the grieving family.
Here are some suggestions for your condolence message:
We’re so sorry for your loss. Our hearts go out to you and your family in your time of sorrow.
Please accept our deepest condolences. Know that you & your family are in our thoughts and prayers, always.
Though our words can do little to ease your sorrows, please know that you'll always have our support during your time of need.
Try to avoid generic, cookie cutter phrases like:
Be strong.
Everything happens for a reason.
I understand how you feel.