Quarterback Alex Smith had the best half of passing in his NFL career Sunday as the 49ers built a 17-3 lead at halftime over the Buffalo Bills at Candlestick Park.