I forget where we got the rule from, but we use this in our game:
Firing into melee is done with a -4 penalty to hit unless you have Precise Shot, which eliminates the penalty.
If you miss your target by more than 4 points, you roll randomly to determine who in the nearby radius (usually 1 square) might be hit, friend or foe. You then re-roll the attack and see if the new target is hit or not. If the second roll is also a miss, the shot is assumed to be wild and no other rolls are required. If the original attack roll missed by 4 or fewer points, it is assumed to have bounced off the armour of your target and fallen harmlessly onto the ground.
Natural 1s on the original attack roll are rolled on our fumble chart. A possible result could still be rolling to hit another target.
What this means for our group is that we generally avoid firing into melee while characters are level 1 to roughly level 5. After level 5, any ranged characters usually have a high enough attack bonus or the requisite feat that they rarely miss.
It works for us. YMMV.