Light infantry often carried small or medium sized shields. Peltasts for example carried their own type of shield. Even a buckler offers some form of protection against arrows. Not all light infantry carried shields, but many did. any kind of shield, even a simple wicker shield gives fair to reasonable protection against arrows. That's the defense side.
On the offense side, you don't have that much time to make it count. You have a range of about 50 to 100 meters for most bowmen. 50 meters is more likely. A running man can do that in less than 15 seconds. Given that his life is on the line, probably faster. How many arrows can an archer fire? Two, if he is speedy and lucky. Perhaps even three, if those archers are very experienced.
It's not enough to hit your enemy, but you need to render him combat ineffective as well. An angry infantryman with an arrow in his hip can kill you just as well as an unhurt enemy.
That's pretty difficult, even for an experienced archers equipped with a heavy longbow. Most archers weren't that good, and didn't have such powerful weapons.
I didn't mention combat stress. That's something you have to figure in as well. Shooting at a stationary target is vastly different from shooting at a rapidly approaching enemy who will definitely try to kill you within next few seconds. It's quite likely your archer won't even shoot that arrow, and either runs away (most likely) or grabs whatever he is carrying to defend himself.
Under normal circumstances archers would try to barricade themselves, so they can't be easily overrun. Light infantry normally wouldn't bluntly charge a line of archers.
Actually, a proficient, quick-firing archer would be able to kill a few melee soldiers
It's surprisingly difficult to kill an enemy. Even with modern rifles it takes a lot of ammunition to do just that. I don't have figures at hand, but several thousand (on average) is what you'll need at least. Even expert bowmen cannot match a rifle in accuracy. Making one kill is pretty good already.