Joey LoganoChris Graythen/Getty Images

One week after running out of gas on the final laps at Pocono, Joey Logano won a chaotic Cheez-It 355 at Watkins Glen when he was able to pass Kevin Harvick, who himself ran out of gas, in the final turns of the final lap of the road course.

Things started to get hairy with about 15 laps to go. During the next five laps, several in-car communications revealed that teams were telling their drivers they didn’t have enough fuel to reach the finish line, with most teams calculating that they were one to three laps short.

The big problem for the drivers is that they have no fuel gauge in the car. They depend on the calculations made by their crews and hope that jives with how drivers are using their cars.

The only hope for most drivers was another driver running out of gas before the white flag, which would lead to a caution flag in the final laps. But one never came as the race went green for the final 30 laps.

As the race hit the final laps, several challengers, including Kyle Larson and Dale Earnhardt Jr., had already fallen well off the pace, leaving Harvick (No. 4 car) in the lead but needing to conserve fuel to get to the finish. Harvick was able to go easy until Logano (No. 22 car) caught him. With Logano in the rear-view mirror and having enough fuel, Harvick had to go hard and could no longer conserve his own gas.

NASCAR Kevin HarvickMatt Sullivan/Getty Images

It looked as if it was just a matter of time before Harvick ran out of gas and Logano took over the lead. But then Harvick caught a huge break.

Just as the two leaders entered the final lap, Logano got loose in the first turn, went wide, and nearly lost control of his car. He was able to stay with it and get back on the track, but Harvick then had a huge lead and could once again try to conserve gas as Logano played catch-up.

Harvick had a big lead, but the 2-1/2-mile course at Watkins Glen filled with elevation changes wasn’t helping, making it more difficult to coast.

Snapshot_20150810_074848NBCSN

The first sign something was wrong came as the drivers approached the final two turns. Harvick wasn’t on the right line to hit turn No. 6. At this point, it looked as if Harvick was out of gas.

Snapshot_20150810_075228NBCSN

Sure enough, Logano sprinted past Harvick in the final turn.

Logano even appeared to tap his breaks in front of Harvick’s car to kill any last momentum it may have had.

Snapshot_20150810_075927NBCSN

All Logano needed to do was hit the gas one last time, and he took the checkered flag with Harvick left to coast across the finish line a distant third.

Snapshot_20150810_080241NBCSN