The colour comes chiefly from bilirubin, a product of the break down of haemoglobin. You see, red blood cells transport oxygen around your body. They do so by a protein called haemoglobin, which bonds to the oxygen. red blood cells live about 120 days, after which they are broken down in the spleen, liver and bone marrow. The main by-products are iron, which is mostly re-used (to make new red blood cells), and bilirubin. the bilirubin is excreted, through bile, into the small intestine. Bilirubin at this stage is green. In the small intestine, bacteria transform the bilirubin. The resulting molecule is brown, and this is excreted in the faeces, to give them their brown colour.
Just in case you REALLY wanted to know.