Erm, thanks for the quick reply, but you didn't answer my question. I understand the rules for firing into melee. But what about firing through an ally's square? Let's say an ally is immediately in front of you, and an enemy is two squares beyond your ally. Can you fire through your ally's space, or does the enemy gain cover because your ally is in the way?
I distinctly remember there being a rule saying specifically that firing through an ally's space does not provide cover to the target (though firing through an enemy's space would provide cover, so you can't fire past one enemy to hit another). However, I checked the PHB and found nothing, and I can't seem to find anything online. It may have been a 4e rule. I'm not sure.
The reason I ask is because I just started a 3.5 game where the DM has applied about a thousand and a half house rules to the game (half of which he added for "realism", and the other half he insists are core rules, but I'm certain they aren't). He's constantly telling ranged attackers that they don't have a straight shot because an ally is in the way, and he even went so far as to say that it was flat-out impossible to use a reach weapon to attack a target in the second row. (He said that one enemy standing behind another was equivalent to being completely behind a wall.) If I can find a page reference or some other hard rule, he'll change it, but until I find such a statement, I've gotta deal with my ranged attacker being useless in anything but a wide-open battlefield.