First of all, the biggest counter to the class x is always class x.
You need infantry to stop infantry
You need ranged power to combat ranged power
You need a unit with high mobility to match the enemies' high mobility units
From a strategical point of view, if you're lacking any type of unit in your team, you will always be in a trouble; in most circumstances at least.
That doesn't mean, however; there are no counters to each class. Like:
- shields
- throwing weapons
- yet better, throwing weapons and shields
- cavalry, to prevent them from kiting
- killing the enemy main force, in other words infantry before the archers can do enough damage to your team; as the ranged damage/time ratio is no match for melee damage/time ratio.
- and most importantly, carrying the melee battle to them; high agility infantry excel better in this
- another reliable ranged fire, as it has been already said. And no, throwing is not considered as a "reliable" source of ranged fire in my book. Less ammo, low accuracy, short attack range makes throwing to fulfill a different role, more like skirmishing. (I don't mean any disrespect to throwing weapons. They are very reliable for what they are supposed to be)