Then it becomes time to use snipers, positioned high enough that they can shoot over the front ranks into the men behind them.
Why? Shoot the women and children too.
A .50 will go through a couple of folks.
You think the women and children are any less motivated to kill than the vermin "men?"
And yes, I do know what it's like to have an armed child pointing a gun and/or throwing explosives at me.