Great question — answering as the UphillTech team:
Do not use it. A spark, smoke, and a discolored contact mean the socket is damaged. Heat builds up at a bad contact, and a new bulb will not fix that. Turn the breaker off for that circuit. Replace the socket or the whole fixture. Check the wires behind it for heat damage while you are there. If you are not sure about the wiring, get an electrician. This is one to fix before anyone sleeps under it again.
Full answer by oliverwilliams: https://diy.stackexchange.com/a/333521 (CC BY-SA 4.0).
Need it done for your business? UphillTech.