The invention discloses a medicine for treating gastric ulcer, and a preparation method thereof. The medicine is mainly prepared from atractylodes lancea, officinal magnolia bark, tangerine peel, liquorice, trogopterus dung, cattail pollen, ginseng, root of red-rooted salvia, Chinese yam, coix seed, ark shell, costustoot, sinkiang arnebia root, rhizoma atractylodis macrocephalae, white paeony root, Chinese angelica, bitter orange, dwarf lilyturf tuber, pinellia ternata and astragalus in a certain weight ratio. The medicine has the effects of tonifying spleen and qi, strengthening stomach, clearing liver-fire and eliminating heat, invigorating the circulation of blood and removing blood stasis, nourishing stomach yin, restraining acid, clearing way heat and toxic materials, and invigorating the circulation of blood to relieve pain, has quick response in treatment of gastric ulcer, and is short in a treatment course; and gastric ulcer does not relapse.