From SFWiki
In 1857, the original Market Street Railway was granted the right to run a horse-drawn carriage line along
Market Street. The line opened in 1860 and the Market Street Railway grew into one of the largest transit operators in the city. In 1944, transportation was consolidated when the Market Street Railway sold its assets to
Muni.
More recently, the non-profit that formed to restore historic streetcars took the name. This Market Street Railway is one of the reasons we now have the very popular F-Market & Wharves streetcar line.
More information at the Market Street Railway website, streetcar.org