I think about the movie 300 now everytime spears are in combat with the front guys holding the shields and just trying to stay alive, the second rank stabbing with spears and the rest of the ranks pushing back against the charge.
A good way to think about it, but falls down when you consider that the front rank still get full attacks with spears.. I think of it more as the spears being driven into the ground (butt first) so essentially the front rank does just defend, and it is the charge of the enemy that drives themselves onto the spears. Doesn't really work when the opponent isn't charging, but I guess that works differently anyway.
The way I think of it... the second rank only gets to stabbing range after the lines become entangled.. on a charge the front ranks attack as soon as they come into contact before everything gets entangled. Of course there are always ways you can imagine them "just attacking like this".