Carefully scrape the egg masses into a Ziplock bag. You might find it helpful to squirt water on them first to prevent crumbling and blowing away. Seal the bag and microwave it for 1 minute. Throw the egg masses in the trash. Avoid handling the egg masses, because the hairs covering them may cause a rash.
Pesticides are effective only against gypsy moth caterpillars no other life stage.
Insecticidal soap is readily available at garden centers and is effective against gypsy moth caterpillars.