It is difficult to come up with the right sentiments for such difficult news for a friend. The key is to phrasing what you say is to be considerate, kind, tolerant of their feelings and mood and tactful in speech. Also, try not to act like the whole world is ending. Remember, this person is your friend. Treat them as such.