Is it still heating the food?
Thanks for using JustAnswer.com!
The problem you are describing sounds like it could be a number of things. Honestly I would not recommend any further use of the microwave until a serviceman checks the unit. You may have an issue with what's called a stir blade. This is what disperses the magnetron's energy evenly around inside the cabinet to heat the food. Any issues with this could cause radiation to escape from the microwave. This is not safe.
Best thing to do in your case is too have a professional check the unit. I hope this information has been helpful to you. You can still ask questions to me after you press the accept button. Please feel free to ask!
Thanks again for using JustAnswer.com
The reason for this repair to be done by a professional is because of the use of special equipment used to test the capacitor and diode. You cannot use a regular multimeter to test these. Also if you don't have the equipment to test for radiation leakage from around the microwave this could be hazardous to your family.
With the sparking you are hearing there may be internal damage to the coating of the microwave cavity. This was advised to you for your safety. Not because we didn't want to give you a complete answer.