The rectum is about eight inches long and serves, basically, as a warehouse for poop. It hooks up with the sigmoid colon to the north and with the anal canal to the south.
The rectum has little shelves in it called transverse folds. These folds help keep stool in place until you're ready to go to the bathroom. When you're ready, stool enters the lower rectum, moves into the anal canal, and then passes through the anus on its way out.
Learn more about the anatomy of the large intestine.
Sources:
Goldberg, Stephen. Clinical Anatomy Made Ridiculously Simple. MedMaster, 1999.
Kapit, W. and Elson, L. The Anatomy Coloring Book. Harper Collins, 1977.

