Often pain caused by ulcers can be temporarily relieved by eating foods that buffer the acid in the stomach.