It depends on how close you were to the deceased or to the one whom the message is given. If you knew them, then a personal message is appropriate. If you didn't know the deceased but know the person to whom the message is going to, then the best advice is to keep it simple and sweet.
Know that words are temporary, give the message that you are available for them. This means so much more than anything you can say. Sometimes a kind word, a simple message, and let them know you're thinking about them goes a long way.