It is probably just the coral's mesenterial filaments (its guts basically) that can be expelled outside the polyp during stress, fighting, or feeding (going with stress in this case.)
From the first pic, I didn't see anything wrong. How long had the coral been looking like that? Are any other corals/fish showing signs of stress?