One of the most common causes of sharp pain in the right side under the ribcage is gallbladder disease. Other causes may include kidney stones and constipation.
According to WebMD, a sharp pain that starts in the epigastric area and spreads to the upper right part of the abdomen under the ribs is the most common symptom of gallstones. This pain may prevent a person from taking normal deep breaths. This may last anywhere from 15 minutes to 24 hours. The pain may start at night, often occurring after meals. Other symptoms of gallstone pain include nausea, vomiting and a loss of appetite.