Juventus moved up to second in Serie A after thrashing Sampdoria as AC Milan were denied three points by a dramatic comeback from Napoli.