Hornish moved to Penske's NASCAR program part-time in the Xfinity Series (then known as the Busch Series) during the 2006 season, and began driving part-time in the Sprint Cup Series (then known as the Nextel Cup Series) in 2007. He raced full-time in the Sprint Cup Series the following year, struggling at first, with eight top-ten finishes over his first three seasons and a top points placing of 28th (in 2009). Hornish returned part-time to the Xfinity Series (then known as the Nationwide Series) in 2011, winning one race. He drove full-time in the series the following year, finishing fourth in points. In 2012 Hornish replaced A. J. Allmendinger (suspended by NASCAR for failing a drug test) in Penske's No. 22 car midway through the season, earning one top-five finish. The following year he returned to the Nationwide Series, winning one race and earning 16 top-five and 24 top-ten finishes to place second in points (three behind series champion Austin Dillon). Hornish drove part-time for Joe Gibbs Racing in an eight-race 2014 season, with one win and four top-five finishes. He returned to the Cup Series in 2015 with Richard Petty Motorsports, scoring three top-tens and finishing 26th in points. He returned part-time to the Xfinity Series in 2016, winning a race for JGR and finishing sixth or better in all three races he entered for Richard Childress Racing. In 2017, he returned to Penske's Xfinity program for a three-race schedule in the No. 22.