The treatment of right epigastric pain near ribs needs to be chosen according to the cause of the disease, there are common physiological causes and pathological causes, such as gallbladder stones, hepatitis B, cholecystitis, etc., and the treatment modes are medication, surgery, and so on. 1. Physiological causes: it may be due to the patient has not eaten for too long, resulting in gastrointestinal spasm, and then appear the right upper abdomen near the ribs pain symptoms, usually only lasts for a few seconds or a few minutes, belongs to the normal physiological phenomenon, generally do not need to be treated. 2. gallbladder stones: due to gallbladder stones stuck in the opening of the gallbladder duct causing biliary colic, which leads to the patient to appear right epigastric pain near the ribs, usually can be prescribed to give diazepam tablets, atropine tablets and other medications, can be effective in relieving the right epigastric pain near the ribs symptoms, if necessary, surgical treatment. 3. Hepatitis B: Hepatitis B causes functional biliary dyskinesia and affects the excretion of bile, which leads to pain in the right upper abdomen near the ribs. Usually, you can take entecavir capsule, tenofovir tablets and other drugs for antibacterial treatment as prescribed by the doctor, which can alleviate the symptoms of pain in the right upper abdomen near the ribs by treating the disease. 4. Cholecystitis: due to improper diet, infection and other reasons lead to the occurrence of cholecystitis, inflammatory substances on the gallbladder stimulation and cause gallbladder pain, which leads to the patient to appear right epigastric pain near the ribcage symptoms. Ibuprofen extended-release capsules, indomethacin tablets and other drugs can be given as prescribed by the doctor for treatment, with analgesic and anti-inflammatory effects. It is recommended that patients follow the doctor’s instructions to use the drugs.