Rush hour is bad for cars but pretty good for trains. With 3 hrs, try to make the connection by public transit, and if it doesn't work, ask a UA agent at IAD for help -- 99% sure that although they're not OBLIGED to put you on a later IAD-SFO they WILL if you miss the connection.
DCA to Wiehle-Reston should take under an hour. It's $6 peak/$3.85 off peak with a DC area transit card. It's not a bad transit by train assuming the DC trains are running on time. Unfortunately they haven't finished the Silver Line so you get to take a 15 minute bus ride provided by a private company from Wiehle-Reston to IAD -- this runs every 15 or 20 min and costs $5.
(Alternately take the train 10 min to Rosslyn and take the 5A bus -- I love that bus, but check the timetables as they have cut frequency.)