Skeletons for some reason come close to anyone who attacked them and then shoot attacker from close proximity.
How to reproduce:
1) Find a skeleton
2) Punch it and run few blocks away
3) Watch skleton's reaction - he will come to you as close as possible (melee range) and shoot you once. Then he will behave normally again.
Same applies to any other attacker so for example when skeleton shoots another skleton, the injured skeleton will (try to) come close to the attacking skleton and shoot him from close proximity.