That's your dodge window. If you press dodge (right click?) when in the green, then you don't take any damage.
Once I got the hang of it and understood how it worked, I feel like the timing on that at the moment isn't too bad, and might even be a little generous if players' stats make things easier as the game goes on. I don't feel like I should be able to dodge every single ranged attack.