The safest bet for avoiding traffic during this Sunday's San Francisco Marathon would be to play apartment survivor all day, but in case you don't have the materials one needs for that (mac and cheese, Netflix, mild misanthropy, etc.) here is how you can arm yourself against traffic with knowledge!
First off, the race's traffic advisory is very thorough and you can see what areas will be crazy at what time of day by neighborhood here. The races (except for the second half marathon) start at Mission Street and the Embarcadero. The marathon ends at Folsom Street and the Embarcadero and the first half marathon ends at Golden Gate Park near the Rose Garden.
The Embarcadero will be closed from Kearny to Harrison from midnight Saturday (when the crazy people run the 26.2 mile marathon loop course twice) to 2:45 p.m. on Sunday and you can refer to the map for more detours. The affected bus lines are the 1, 2, 5, 6, 9, 10, 12, 14, 14L, 19, 22, 24, 27, 28, 29, 31, 33, 37, 38, 39, 43, 44, 47, 48, 49, 71, 76X, F, K/T, N, and KLMN. There will also be bus substitution for the 6, 22, 24, and 33. A lot of buses will be "affected" so give yourself more time than usual to get where you're going Sunday – or like I said, buy some mac and cheese and hunker down, San Francisco.
Image courtesy of the San Francisco Marathon