"Good night, friend."
Translation:Oidhche mhath a charaid.
Caraid is the basic nominative form of the word.
When it is used to address someone directly it changes to the vocative case. In the vocative case you put an "h" after the second letter if it is one of the letters you can do that to (and "c" is one of these letters) and you put an "a" in front of the word.
So "caraid" (nominative) becomes "a charaid" (vocative).
You may be interested in the plurals. Nominative plural ("friends") is "caraidean", which is one of the standard ways of forming a plural, by adding "ean" to the singular word. However the vocative plural is "a chàirdean" and honestly don't ask me why. I saw an explanation somewhere but it was some complicated reason about the development of the language.
The reason is that càirdean is the old plural that has simply survived longer in the vocative than in other cases. Mark says
caraid, càirdean nm ally, friend, kinsman, relation, relative □ note that the pl form caraidean is now often used in place of càirdean except in the vocative, although this appears to be quite unnecessary.
In the distant past, Old Irish words, just like Old English words had a large variety of plurals, none of which involved adding -(e)an or -s. In addition there were several different forms in Old Irish
carae, chare, c., carae, carit, carit, charait, cairde, chardde, charaid, charaid, caruit, charuid, cairde, cháirde, chardiu, cardiu, caraid, cairde, cairdeadh
I think some of these are plurals but I am not sure.
But over time both languages simplified, replacing the variety of plural forms with the one-size-fits-all endings - -(e)an in Gaelic and -s in English. Càirdean is actually an intermediate form using both the original vowel change (corresponding to the i in English mice but with the innovative -(e)an as well. This would be a bit like saying *mices in English. It is not surprising that this simplified to just the standard ending.