I agree completely with Red Harvest, 4 ranks is how I always stretch my phalangites and pikes. For Hoplites, and the german spearmen, you have three ranks fighting, and one providing for reserves. Pikes sometimes I like to go for 5, depending on the ground, but the width is very nice on most battlefields, with four pike or german spearmen units stretched to only four ranks deep you can have a front as long as any an opposing army could give, releasing the rest of your army for pure flank work and manuever.

Also, I like to stretch my roman infantry out to 3 ranks, when fighting barbarians, the pilia launch and then a very brief fight in melee (this is of course with the unstanding that you have already pressed on the flanks and have a few units behind the enemy, which is easier if you are able to concentrate more units there) usually sends the babarians routing. Against Phanlangites, I have not attempted to stretch my lads thin. The goal with a spread out line is not to get into extended melee, but rather to free up a heavy flanking force to panic the opposition soonest.