my sympathies; that's too bad; my condolences
Polite expression used to show sympathy for someone's misfortune or loss. Often used as a set phrase.
お気の毒に、それは大変でしたね。
My sympathies, that must have been tough.
ご家族のことを聞きました。お気の毒に。
I heard about your family. My condolences.
ご愁傷様 is a set phrase almost exclusively used at funerals to offer condolences, whereas お気の毒に covers a wider range of unfortunate situations.
残念 expresses one's own regret or disappointment about a situation, while お気の毒に specifically conveys sympathy for someone else's misfortune.
気の毒 is the plain adjective describing something pitiable, while お気の毒に is its polite adverbial form used to directly express sympathy to someone.
Polite prefix お + 気の毒 (regrettable, pitiful) + adverbial particle に. The phrase literally means 'in a regrettable manner' and is used as a set expression of sympathy.