After reading a thread debating rules about firing arrows into a mêlée, I thought I'd mention my simple solution to this: the archer rolls a single attack roll; every participant in a mêlée rolls a d6. Whoever rolls highest on their d6 roll is the target; look up the target number for their armor class and figure out if they are hit.
If there's a tie, start with the combatant with the lowest Dex or Move score. That's the first target. After checking whether they are hit, move on to the combatant with the next lowest Dex score, and so on. Either stop when someone is hit, or if you want "blow through", decide how many victims the arrow can pass through before it stops completely. You might want to just say "one arrow can only harm a maximum of two people" or you might vary the number based on the ranged weapon being used.
Personally, I wouldn't bother having the archer roll the d20 more than once. Just use that one result against multiple targets. I suppose if you wanted fewer ties, you could make everyone in the mêlée roll a d20 instead of a d6, but it's easier to explain it as d20 for attack, d6 for the targets. Plus, you can skip an additional damage roll and just say if you're hit, the d6 you rolled is how much damage you take.