It could be a bleeding ulcer. You need to go get a Upper GI and/or a gastroscopy to find out.
First off - you need to see a physician (a gastroenterologist) - it sounds like you have a GI bleed.
However, tell me a little bit more about yourself and maybe I can give you an idea of what to expect. How old are you? Do you smoke, if so how much and for how long? Do you drink, if so how much? Do do you have a history of acid reflux? Is the pain worse after you eat, or does eating relieve it? Have you vomited any blood? Have you noticed any blood in your stools? You still need to see a Dr. but if you can answer those questions I can at least try to give you an idea of what MAY be going on.