The aim of this study was to evaluate the clinical utility of an image-guided Raman endoscopy technique for in vivo differential diagnosis of benign and malignant ulcerous lesions in the stomach. A rapid-acquisition image-guided Raman endoscopy system with 785 nm laser excitation has been developed to acquire in vivo gastric tissue Raman spectra within 0.5 s during clinical gastroscopic examinations. A total of 1102 in vivo Raman spectra were acquired from 71 gastric patients, in which 924 Raman spectra were from normal tissue, 111 Raman spectra were from benign ulcers whereas 67 Raman spectra were from ulcerated adenocarcinoma. There were distinctive spectral differences in Raman spectra among normal mucosa, benign ulcers and malignant ulcers, particularly in the spectral ranges of 800–900, 1000–1100, 1245–1335, 1440–1450 and 1500–1800 cm−1, which primarily contain signals related to proteins, DNA, lipids and blood. The malignant ulcerous lesions showed Raman signals to be mainly associated with abnormal nuclear activity and decrease in lipids as compared to benign ulcers. Partial least squares-discriminant analysis (PLS-DA) was employed to generate multi-class diagnostic algorithms for classification of Raman spectra of different gastric tissue types. The PLS-DA algorithms together with leave-one tissue site-out, cross validation technique yielded diagnostic sensitivities of 90.8%, 84.7%, 82.1%, and specificities of 93.8%, 94.5%, 95.3%, respectively, for classification of normal mucosa, benign and malignant ulcerous lesions in the stomach. This work demonstrates that image-guided Raman endoscopy technique associated with PLS-DA diagnostic algorithms has for the first time promising clinical potential for rapid, in vivo diagnosis and detection of malignant ulcerous gastric lesions at the molecular level.