In early July 1968, while on an hour long drive in his Aston Martin, Paul McCartney began singing a song that came to him called Hey Julian. He quickly shortened it to Hey Jules, named after John Lennon's son Julian.

Paul was driving to John’s former home in Weybridge to visit Lennon's ex wife Cynthia and son Julian.

John Lennon , having moved to London with Yoko Ono had recently finalized his divorce from Cynthia. Cynthia and Paul were good friends going back to Liverpool days. Paul felt sorry for Julian, he was sensitive to child’s feelings after the divorce and wanted to comfort him. To tell him it would be ok.[Interview]

The lyrics were further worked on to bring in a broader theme. One episode that Paul fondly remembers is the time John and Yoko were visiting and Paul played Hey Jude for them. When he reached the ‘The movement you need is on your shoulder’, he turned to John and said, this line makes no sense and he would take it out. [Interview]

So Paul left it in and even these many years later when singing the line, remembers John and the great friendship they had.

Hey Jude was recorded on July 29, 1968. Here is a section from an early take with some studio chatter which has survived the years.

One humorous incident Paul recalled was on what would become the master take, Paul started but didn’t realize that Ringo had left for a bathroom break. As he was singing he saw Ringo tip toeing quickly back to the drum set, in time for his perfectly executed drum fill entrance.

Contrary to common belief, the end section is not a separate song, and goes on so long because he got carried away ad-libbing. At 7 minutes, it was the longest single up to that time, with Revolution on the B side.

It entered the US charts on Sept 14 where it stayed for nineteen weeks including nine weeks at #1 and remains the Beatles top selling single.