If this pain tends to spread to the back and is accompanied with other symptoms like nausea, vomiting, rapid heart pulse, made worse after eating or drinking, could be a pancreatic inflammation.
Sharp pain under rib cage may indicate a case of pneumonia, if you suffer from symptoms of cold, fever, chest pains and coughing.
Problems with spleen or aggravated stomach ulcer need to be taken in consideration, too.