A man has been left in a serious condition in hospital after a flat fire, the emergency services have said.