This Chinese(mainly Cantonese dialect) exclamation generally used at the end of a sentence to express frustration, trouble, and empathy. When used by non-Chinese speakers, this sounds completely ugly and dumb. Refrain from using this expression if the preceding sentence is NOT in Chinese or risk sounding like a lame wannabe.
Also spelt (aiya) - It is a Nigerian (probably used in some other West African countries too) "word" phrase used to express commiseration, pity or concern when someone suffers any kind of misfortune.
Example 1:
John: I just found out I did not pass the Navy Seal test
Doe: Ai ya! May be you try again next time.