Hard to tell without more information, but what I can offer is that Berners have sensitive digestive tracts. This is actually commonly discussed as one of their "weaker" systems and why so many of us do not feed processed food as a result. All of my Berners have had sensitive digestive systems, and my boy used to vomit bile occasionally.
Frequent bile vomiting is indicative of a bile motility disorder - since bile serves as the "laundry detergent" if you will for the digestive process.
This can also be a reflection of acid reflux basically, especially if it occurs after exertion. If his system is too acid, this can be addressed through diet. Since vets are not trained in nutrition at all, they will only advise an antacid be given or some prescription diet sittin on their shelf - avoid these as they mess up the rest of the digestive balance and you will ultimately see other problems. If this is the case, and it is ignored, it will worsen and damage the esophagus. Digestinol is the best and most effective product I have seen as curing inflammation anywhere in the digestive tract should this be needed.
Then again, this could also be a throat irritation since you say he gags several times before heaving. Gagging can be real or imagined in a dog - in other words, something could really be logged in there or otherwise bothering him, or he scratched his throat consuming something and now the scratch feels like something is there and he trying to remove it. I would start here to make sure there isn't something there and I would feed him some soothing things to try to alleviate in case this is the culprit. Some warm, low sodium organic chicken broth with slippery elm usually does the trick. Raw organic honey is also helpful.
If this doesn't work, then look at what you are feeding and evaluate the entire health picture here - it is likely he will be a sensitive boy digestion-wise and may be too acid or even too alkaline, or bile is not working properly.