I was reading my history book, and it stated that the Battle of Somme caused at least 20,000 casualties just to British troops, and another 25,000 to German troops. What happens to the dead bodies after the battle? Do they mass bury them, or burn them?
In many cases they are buried, that is assuming they can be identified. During WW1 at least, local ceasefires were often organized to allow both sides to recover their dead. The brutal nature of war, however, often led to soldiers being maimed beyond recognition. They are sometimes buried individually regardless if the situation allows, although mass graves have often been used. (I even recall cases where the fallen have been hastily buried in a mass grave and later, when the situation allows, dug up and buried individually, but I cannot recall when and where.)
This differs a lot across nations and continents. The Germans often buried dead enemy pilots with full military honors, for example. During Winter War and Continuation War, Soviet fallen were often buried in hastily-made mass graves due to the epidemic risk caused by rotting bodies, as there were so many of them that individual burial was not feasible. Fallen sailors were practically always permanently lost and could not be buried, some soldiers would end up MIA, some got hit so badly no one could identify them. These soldiers who lost their lives but did not get a proper burial for one reason or another are often commemorated in various ways.
A good example of unidentified fallen is the memorial for the fallen British troops at Somme, the Thiepval Memorial, commemorating 72 246 British soldiers who died at Somme during the entire first world war but could not be identified.
Another example would be the Tomb of the Unknown Soldier. There are several all across the world, but the most well-known ones are probably in Arlington military cemetery in the USA and the one in Paris under Arc de Triomphe. These are dedicated to all fallen and missing servicemen.
So, to sum up the answer: Buried individually if the situation allows and the fallen can be identified, unidentified may be either buried individually or in mass graves depending on the situation and the protocol in the involved armed forces.
Edit: As @TheHonRose commented, the first example of the Tomb of the Unknown Soldier is from UK, where an unidentified casualty of WW1 was buried on armstice day in 1920 with full military honors in Westminster Abbey, simultaneously with a similar ceremony in Paris, under Arc de Triomphe. Thus, these two are the first known examples of the Tomb of the Unknown Soldier.
Sometimes the bodies would be buried were they had fallen, or placed into mass graves, especially if ground was constantly being lost/ regained, such as the Western Front.
War graves team were dispatched to secured battlefields to find and identify bodies that had been buried, using records and journals of the officers in command.
It could be long after the war that war graves teams had exhausted themselves searching - the Gallipoli team worked into the mid 1920s https://www.awm.gov.au/blog/2015/01/19/establishing-gallipolis-graves/
And bodies are still being found on these sites http://www.newsweek.com/world-war-1-261816