I'll guess that the hanger broke off the frame and the derailleur is hanging free on the chain.
If you're lucky, your frame has a replaceable hanger, but the derailleur itself may be bent -- perhaps beyond salvage -- and the hanger alignment on the frame may need adjustment. Unless you have the tools and skill to undertake this job,your best bet is to take your bike to your LBS and have them assess the damage.