According to the usual account, while working with radar equipment at Raytheon around 1945, Percy Spencer noticed that microwaves from the device had melted a candy bar in his pocket.
Raytheon filed a patent application for microwave cooking in October 1945 and began selling the first commercial microwave oven, the Radarange, in 1947.