The M79 was designed as a lightweight sidearm capable of firing 40mm grenades over long distances. Nicknamed the "thumper" due to it's distinct sound when fired.
The Thumper replaces the underbarrel GL from BC2, but works in largely the same way. Useless if you don't know how to use it, deadly if you do. Unlike in CoD, players can not simply point and shoot to get a kill, as grenades need to land fairly close to a player to register a kill.
The most suitable use for the M79 is as a support weapon. Firing it near where enemies are can cause them to move out of cover, making them potentially easy targets. With good practice players can aim the Thumper precisely, and use it to clear out fortified positions.