Geno Smith threw two touchdown passes, including a go-ahead 69-yarder to Santonio Holmes in the fourth quarter, and the New York Jets overcame a team-record 20 penalties to hang on and beat the Buffalo Bills 27-20 in an ugly game Sunday.