It was the dead Marshalls Brother!
2nd answer on 11/22/09
While it has been speculated that the stranger is Marshall Duncan's brother the movie makes it pretty plain that it is Duncan's ghost.
In the intro it shows the stranger materialising out of nowhere and then as he rides off he disappears. The dialog that the stranger has with Sarah Belding after they sleep together insinuates that she knows or suspects that he is Jim Duncan returning to avenge his death and teach the town a lesson. Out of all the town's people that the stranger humiliates it is only Sarah that he doesn't do this to...the reason being she was the only one who protested and tried to stop Marshall Duncan's murder. Her actions with the stranger are her own and she is not forced or humiliated in any way. When she tell's the stranger that Jim Duncan is lying out there in an unmarked grave, the stranger's look towards the grave yard means he knows that he will never rest until his grave is properly marked.
The clincher is at the end when Mordecai is finally marking Duncan's head stone and he asks for the stranger's name to which the stranger tells him that he already knows it...implying that Mordecai has already met him or the two are already acquainted from the past.
If the stranger was Duncan's brother he wouldn't appear and disappear into thin air as he rides on the plains, he wouldn't have any idea as to Sarah's actions during the Marshall's murder, and he wouldn't tell Mordecai that they already know one another.