Stop using it
Unplug it first
Until you know what was running, treat it as unsafe. Pull the plug or switch off the breaker before you do anything else.

Safety first
Unplug the microwave, or switch off its breaker, before anything else. Don't stand in front of the open door while it is running, and don't run it again to see what happens.
Never take the outer cover off a microwave. A part inside called the high-voltage capacitor can hold a dangerous charge even when the microwave is unplugged. Every check here is done from the outside or inside the cooking space, and never run it empty to test it.
Once that's done, 2 quick checks will help narrow it down.
Unplug it and stop using it. A microwave must never heat with the door open, and the FDA says to stop using one that keeps operating with the door open, because you can't be sure it isn't giving off microwave energy. The cause is a failed door switch or a stuck relay on the control board, and both are inside the cabinet. There is one exception. The light coming on when you open the door is normal, and on an over-the-range model so are the vent fan and the cooktop lights running with the door open.
Stop using it for now
Unplug the microwave, or switch off its breaker, before anything else. Don't stand in front of the open door while it is running, and don't run it again to see what happens.
Never take the outer cover off a microwave. A part inside called the high-voltage capacitor can hold a dangerous charge even when the microwave is unplugged. Every check here is done from the outside or inside the cooking space, and never run it empty to test it.
Do this first. Pull the plug. For an over-the-range or built-in model with the plug out of reach, switch off its breaker.
Think back to what you saw and heard. The light alone is one thing. The turntable turning, a hum, or the timer still counting down is another.
Stop using it
Until you know what was running, treat it as unsafe. Pull the plug or switch off the breaker before you do anything else.
Try this first
The inside light comes on whenever the door is open so you can see your food. As long as everything else stops the moment the door opens, the microwave is working the way it was designed to.
Try this first
The vent fan and the cooktop lights underneath are separate from the cooking parts, and they work whether the door is open or shut. On many models the vent fan also starts by itself when heat from the cooktop builds up underneath, which is normal.
Stop using it
Every microwave has at least two separate door interlocks that cut the microwave energy the moment the door opens, plus a monitor that shuts the oven down if they fail. If the turntable, the hum or the countdown carries on with the door open, part of that system isn't working, and you can't tell from the outside whether it is still heating. Don't test it again. It needs a technician to replace the door switches or the control board.
It usually turns out to be one of these
If every check comes back fine
If you can't say what was running, don't run it again to find out. Leave it unplugged and call Nate's Appliance Repair at (509) 960-5505. Tell us what you saw and heard with the door open, and whether it is a countertop, over-the-range or built-in microwave.
It usually turns out to be one of these

He repairs microwaves in homes around Spokane and Spokane Valley.
Monday to Friday, 8am to 5pm. Or email service@natesappliancerepair.com, or send us a message
Here's what to tell us
My microwave is running with the door open.
The brand and model number help too, if you can find them.
We don't work on Bosch appliances.
Treat it as dangerous. The door interlocks are what stop the microwave energy when the door opens. The FDA's advice is to stop using a microwave that continues to operate with the door open.
No. The light is on a separate circuit and comes on whenever the door is open. What matters is whether the hum, the fan and the turntable stop when the door opens.
That is the reason the FDA says not to use a microwave whose door doesn't close firmly or is bent, warped or otherwise damaged. If the door, hinges, latch or seal look damaged, unplug it and have it checked.