Tim Lincecum threw six scoreless innings, Pablo Sandoval hit a solo homer and the San Francisco Giants beat the Philadelphia Phillies 4-1 on Thursday night in their first game with Carlos Beltran.