The verses in the main body of the song are by Lennon, the first and last inspired by actual stories that he read in the newspaper. The overall tone would be bleak, indeed, were it not for McCartney's added line, "I'd love to turn you on," which, though it is worded in the drug parlance of the day, is more about uplifting one's spirits, transcending the everyday to a more enlightened state of awareness. In addition to this all-important line, McCartney had an unfinished song which perfectly complemented John's verses. When joined together, the two sections painted a stunning portrait of the everyman in the Western world in the latter half of the 20th century.
The basic track was laid down on January 19th, 1967. It featured Paul on piano, John on acoustic guitar, maracas (probably Ringo) and barely-audible bongos (reportedly George). John also recorded his haunting lead vocal on this day. Between the first three verses and Paul's section of the song, they left an extended gap of 24 measures, not quite sure how they were going to fill it up. Their assistant Mal Evans, his voice drenched in echo, counted off the measures, then set off an alarm clock to mark the end of that section. Since the first line of Paul's section is, "Woke up, fell out of bed," the alarm clock was kept in the master. After John's final verse, Mal's counting was repeated (minus the alarm clock), and then, the song abruptly stopped.
They returned to the studio the next day and recorded three overdubs, but these were all wiped and redone on February 3rd. These included Paul's vocal for his section, plus his bass line and Ringo's drums. In Derek Taylor's book It Was Twenty Years Ago Today, musician Al Kooper talks about the drumming, saying, "...this record had what I call 'space fills' where they would leave a tremendous amount of air." He was talking about Sgt. Pepper in general, but the comment especially applies to Ringo's work on the early verses of this track, where he displays an uncanny feel for what is just right in the moment.
Eventually, Paul figured out what to do to fill in the 24-measure gap. On February 10th, forty musicians in full evening dress gathered in studio one at Abbey Road. Producer George Martin, also in evening dress, had written out a most peculiar score for them to play. Each instrument was to start at its lowest possible note, then slowly slide up to its highest possible note ending in an E-major chord. The musicians were to pay no attention to one another in order to make the sound absolutely chaotic. As Paul assisted Martin in conducting the bewildered orchestra, the other Beatles and their friends wandered around with cameras and passed out silly party favors. Mark Lewisohn says in The Beatles: Recording Sessions that four good takes were overdubbed by two four-track machines linked together on that day to produce the sound of a 160-piece orchestra.
After the musicians were dismissed, Lewisohn reports that Paul gathered the others (including Mick Jagger, Keith Richard, Marianne Faithfull, Donovan, and Michael Nesmith of the Monkees) around a microphone to record an extended hum which was to follow the second orchestral crescendo and end the song. Despite much laughter, they ultimately succeeded and the song was complete...
...until February 22nd, when a better idea emerged. An E-major chord, the same one played by the orchestra at the peak of the crescendo, would be struck on three pianos simultaneously. Sounds pretty simple, but it took nine takes before John, Paul, Ringo and Mal Evans could hit the keys at exactly the same instant. Then, with the sustain pedals on the pianos held down, engineer Geoff Emerick played the faders of the control board like a virtuoso to capture every last second of decaying sound. The combination of the orchestra and the pianos achieved what John had wanted all along, "a sound like the end of the world."
Coming at the end of Sgt. Pepper as the encore-to-end-all-encores, it lends the frothy, psychedelic album some much-needed gravitas. Indeed, more than any other song on the record, it is responsible for the album's reputation as a great work of art. No less a person than the composer and conductor Leonard Bernstein said in an interview*, "...Three bars of 'A Day in the Life' still sustain me, rejuvenate me, inflame my senses and sensibilities."
*quoted in William J. Dowlding's Beatlesongs, from The Beatles by Geoffrey Stokes (1979), via Companion