The Pathfinder system has improved rules for handling grappling but I ran into a situation where a character was grappled and another character wanted to hit the grappling monster with a melee attack. It seems like there should be a penalty or chance to hit the other party in the grapple when attacking.

The rules clearly define what the grappling/grappled party can/cannot do (and any penalties/bonuses they get) but I can't find anything that talks about how it would affect incoming attacks (be they ranged/melee) into the grapple.