Yellow in the vomit means that the small intestine is refluxing bile into the stomach so that when he vomits you see the yellow color. That isn't normal as bile doesn't belong in the stomach, and it does mean that there is some reverse motility, but it isn't specific for any particular disease process. Vomiting foam simply is a mix of air and stomach/esophageal mucous made when he retches, it is not indicative of any disease process but tells us he is quite nauseous.
In many cases vomiting is triggered by eating something they should not, too much table food, too many treats or something they find outdoors. More serious causes of vomiting include viral or bacterial infections, chronic pancreatitis, a dietary allergy or sensitivity, inflammatory bowel disease, internal organ failure (kidney or liver disease), ketoacidotic diabetes, a full or partial gastrointestinal obstruction, an abdominal mass placing pressure on her gastrointestinal tract, or infiltrative cancers such as lymphoma.
In some cases though vomiting can be related to a medication. Metacam (generic name Meloxicam) is a nonsteroidal we do use in dogs. It is generally well tolerated but chronic use can lead to side effects including vomiting, diarrhea, abdominal pain, loss of appetite, stomach ulcers, blood in the stools, and acute kidney failure.
While some dogs tolerate a long term dose better than others it is possible he reacted to it. Ideally if this persists he would be seen on an urgent basis today.
If emergency care is not available at home now to try and decrease acid production in his stomach and lessen any possible symptoms you can give either:
1) Pepcid ac (famotidine) at a dose of one 10mg tablet per 15 to 40 pounds of body weight every 12 hours
2) Prilosec (omeprazole) at a dose of one 20mg tablet per 30 to 80 pounds of body weight every 12-24 hours
3) Ranitidine at a dose of one 75mg tablet per 75 to 150 pounds of body weight every 8-12 hours
These are acid reducers that are found over the counter at the drug store. They are the same ones that people take. Any of these can be given as needed for the next several days.
Then if he stops vomiting 6-8 hours after the acid reducer you can offer a bland diet for the next several days. A homemade bland diet is a mix of 1/3 boiled minced white skinless chicken or lean boiled hamburger and 2/3 boiled white rice mixed with some low salt chicken broth to make it easy to lap up and swallow and get in plenty of fluids. Feed small meals frequently.
Things to watch for tonight that mean trouble include continued vomiting, especially blood tinged, dark, black or tarry stools, or frank blood in the stools, lack of an appetite, increased water consumption and urination.
But ideally if this is related to the Metacam he should be seen and started on fluids to try to support kidney function and drugs to avoid ulcer formation. Emergency care is truly his best chance of doing well.
It has been my pleasure to help you today, and I hope that I have earned my 5 star rating. Please remember to rate my service by selecting the 5 stars at the top of the screen (rating me now does not close your question). You are welcome to ask follow up questions about my response here until you are satisfied, simply use the reply box and let me know. Thank you!