Two of Shakespeare's earliest plays, Richard III and Romeo and Juliet, open with sonnets and then employ variations on the sonnet's structure for dramatic and poetic effect. This isn't surprising. At this point in Shakespeare's life he seems to have had dual career goals. First, he wanted to make money, which he could accomplish through theater. But in Elizabethan times theater was still considered hack work. To earn respect as a literary star he had to write poetry, good and popular poetry.
So during the plague years of 1592 and 1593, while the theaters were closed, Shakespeare wrote and published two long narrative poems, Venus and Adonis and The Rape of Lucrece. His literary star immediately rose with these very popular works. He also may have begun writing sonnets. Although his sonnets were not published until 1609, Francis Meres wrote, in his commonplace book, Palladis Tamia, Wits Treasury (1598), “The witty soul of Ovid lives in mellifluous & honey-tongued Shakespeare, witness his Venus and Adonis, his Lucrece, his sugared sonnets among his private friends, &c..”
Having the instrument of the sonnet in his tool chest, Shakespeare found occasion to employ it in his plays. Read the Notes on the opening lines of Richard III, “Now is the winter of our discontent…” to learn how and why he used the sonnet dramatically. Then follow the links within Richard's Notes to the Notes on the sonnets in Romeo and Juliet, beginning with, “In fair Verona where we lay our scene…”