I've had similar experiences, thought mine don't sound nearly as painful as yours. I would have no warning, and then upon intaking i would get a sharp pain as well. Very slow, cautious deep breaths always helped. It's been a long time since it happened, but i think its likely that inhaling smoke...