If you find yourself in this situation, then there's a few steps you can take - firstly try to extinguish the fire as quickly as possible by pouring as much water as you can on the flames, and stamping out any embers that build up as quickly as you (safely) can. Urinating on the fire would also not be out of the question here, especially if your water source is scarce.
If it looks like the fire is spreading quickly in one direction, and it doesn't look like you can stop it outright, then move on a bit in that direction and work to clear any flammable material out of the fire's path. When the fire then reaches that point, this may give you a better angle to tackle it again. If things reach this point however, you should delegate someone to phone the emergency services.
Work in two main teams if you can, one group moving (firstly) children / people to safety, then ideally your belongings to safety - and the second working to extinguish the fire via the methods above. The group moving things to safety can join the first group in extinguishing the fire when their task is complete.
It's also worth remembering the practical side of things in how you address people can make all the difference. Delegate swiftly, efficiently and firmly, give people instructions by name and don't, however tempting it is, start yelling out "WHO THE HECK LET THIS FIRE GO OUT OF CONTROL" (or words to that effect.) Sure thing, someone screwed up if things have got to this level, but you can deal with that later - you're putting lives at risk if you start dishing out blame at this point.
However, it's worth remembering that the above is a real, real last resort and is in no way a sure fire guide (no pun intended) to safely putting out a blaze. It usually goes without saying in all cases, but especially here - prevention is several orders of magnitude better than cure. Preparation is key:
Don't start a fire that you don't have an effective means of putting out. Make sure you have plenty of water on standby reserved for pouring on the fire if things go sour (you should have this anyway for pouring on the fire when you're done, to make sure it's extinguished.)
Even better than the above if possible, light a fire next to a water source. This has three main benefits - it provides readily available access to all the water you need for cooking, which you will likely be doing with a fire anyway, it provides the above for putting out the fire if things go sour, and if the fire does spread you don't need to worry in the direction of the river.
Don't ever start a fire someone that's surrounded by flammable material. If you really can't find a place that isn't, clear a generous area around it of debris so that embers don't set anything alight that you didn't intend. If it's windy, then clear an extra large space around the fire, especially in the direction of the prevailing wind.
Always watch the fire yourself, or if you have to leave, leave it in charge of a single person which you trust. Don't say to everyone "ah, just watch it while I'm gone" - chances are no-one will really, and everyone will just point to everyone else if something goes wrong. Delegate the responsibility to a single, competent individual who has sufficient training.
Keep your stuff, especially tents, a fair distance from the fire to start with. This may not seem ideal in, say windy weather from a comfort point of view, but is an important safety consideration.
tl;dr You should be aware of the steps for how to deal with an out of control fire, but if the proper precautions are taken, you should very rarely or never need to resort to them. Prevention is 100x better than cure in this case.