It sounds like it may be a gall bladder problem , so get it checked out, an attack usually starts below the ribs on the right and can radiate up and into the back, very painful. Low fat diet will help if you research there are lists of foods to eat and foods to avoid that trigger an attack.Do not eat late in the evening ,keep meals light, lemon juice helps .good luck
Welcome to the gastroenterology community! Does this pain correlate with when you have eaten at all?