First, get everybody out of the house and call 911
if you have a chimney fire extinguisher, use it
if possible, close any glass doors or damper on the fireplace and any air openings on a stove.
Before using the chimney again make sure you have it inspected and cleaned by a professional before you use it again