Swollen and painful gums will hurt more when you sleep are usually caused by periodontitis, pulpitis, apical periodontitis, etc. Periodontitis requires periodontal treatment, and pulpitis and apical periodontitis can be treated with root canal therapy. 1. Periodontitis: Periodontitis is mainly caused by bacterial and viral infections, patients will have symptoms of swollen gums, pain, patients can be periodontal treatment, while you can take metronidazole, ornidazole and other drugs under the guidance of the doctor, with antibacterial and anti-inflammatory effect, allergy to drugs is prohibited. 2. Pulpitis: Pulpitis is mainly caused by congestion of the teeth, there will be pain, swollen gums, when the patient lies down due to the blood flow will lead to, the pressure in the pulp cavity and thus increase the pressure leads to sleep more painful, the patient can be root canal treatment under the guidance of the doctor. 3. Periapical periodontitis: mostly developed from pulpitis, patients will appear red gums, pain and swelling, bite pain, spontaneous swelling and pain and other symptoms, when the patient lies down due to blood reflux, localized swelling and pain is obvious, it will lead to more pain, you can under the guidance of the doctor for root canal treatment. If the gums are swollen and painful sleep will be more painful has not been better to go to the hospital in time for examination, under the guidance of the doctor on the cause of the treatment.