Matthew Stafford threw a 5-yard touchdown pass to Kevin Smith with 10 seconds left, lifting the Detroit Lions to a 27-23 win over the St. Louis Rams on Sunday.