Hi Sir or Madam,
How old is your dog?
What breed is your dog?
When did she last eat?
Is her abdomen extended?
Did she vomit anything up?
Will she eat and drink?
Is she anxious?
What color are her gums?
Are her vaccinations up to date?
This does concern me. Dry heaves can indicate bloat, but you state that she did vomit up substance. I'll give you some information on bloat so you have it handy. (Gastric Dilatation) may or may not involve stomach torsion (twisted stomach). Common symptoms are attempts to vomit (usually unsuccessful) and may continue to try to vomit, dog just doesn't seem like themselves, a hunched up posture, anxiety and restlessness, a distended stomach that is tight like a drum, gums may be dark red in early stages and white or blue in later stages. These are the most common symptoms and the list goes on. If you believe your dog has bloat they should be seen immediately. Simethicone products like gas-x may help while you take her into the vet. You can read more on bloat here.
However, a dog with an intestinal obstruction might also have continued attempts to vomit and then vomit up a brownish substance that smells like fecal matter. This is because the waste matter has not other outlet but the way it came in. In these cases, the dog is usually unable to defecate as well or if they can, it is diarrhea. You can read about intestinal obstructions here:
Vomiting a yellow foamy substance indicated excess bile in the stomach and may be the result of an empty stomach. There are several things you can do to help with this type of situation. You can give your dog some pepcid or Zantac. Read about Pepcid dosages and usage information here: http://www.petplace.com/drug-library/famotidine-pepcid/page1.aspx
Zantac can be given to a dog at .25 to 1mg per pound every 8-12 hours. Read about usage here:
You might try medication and then after about 30-45 minutes try offering a small portion of boiled chicken and rice. I'd also put a drop of karo or pancake syrup on her tongue to keep her glucose levels up and prevent hypoglycemia. You can read about that here:
If you know or suspect that she ate a bone, or ingested a foreign object, then I'd have her seen immediately so an x-ray can be done to determine if a blockage is present. I'd also have her seen if the above suggestions don't help.
I hope this information is helpful to you..