I don't have any published rules, so when I went to run a mass combat I thought about it a little and said, "Treat military units as creatures". So a band of 20 pikemen is the equivalent of say a 2nd-level warrior with a pike, and a band of 20 goblins is a goblin. Increase the effective square size, decrease the number of squares each unit can move by the same amount, and throw 'em at each other.
It got a little more complex when PCs were involved, but I just said, "Give the band a PC's in the PC's BAB and stuff", and noted that the maximum number of troops that can attack at once was 8. Oh, and divide all PC-pnly damage to units by 20. One of the PCs actually left his cavalry unit to fend for themselves, and rode into the middle of an enemy unit leaving a trail of bodies behind him. It was quite fun. It also allows for exceptional units with a minimum of tweaking.
Then again, it was only a small skirmish (500 soldiers on the larger side). I may have to expand beyond homebrew for the next battle.