Truex had dominated the race before surrendering the lead late and then pushed hard to regain it, but ended up finishing 0.7 seconds behind Hamlin, who notched his second Sprint Cup win of the year.
Hamlin also won at Phoenix last month.
Truex, meanwhile, fell short in his bid to snap a 174-race winless streak and register his first victory since 2007 at Dover.
Wisconsin business offering 'therapeutic cuddling' forced to close
Campus cop fatally shoots Texas student during traffic stop