Hello,
Welcome to ehealthforum
It seems you are suffering from severe gastritis which is causing these symptoms.The constant irritation of the stomach and oesophagus can lead to ulcer formation and it might be that the possibility of ulcer being present is suspected as Tagamet is usually given for healing of the stomach and GI tract caused by ulcers and also helps in reducing the acid formation.It is usual to have rib pain and soreness along with it.
The healing might take a week or so and gradually the symptoms would reduce.Some suggestions:
1)Have small frequent meals in a day and avoid all kind of processed,oily,junk food items as it will definitely increase the pain.
2)Avoid tea,coffee and hot drinks.
3)Drink lots of water and have fruits,salads and veggies in diet.
4)Restrict smoking and alcohol.
Do not take stress.You will be better in a fortnight.
Take Care!