Capturing groups is always harder then shooting one portrait at a time, especially in those spontaneous moments. First of all, there are more eyes to notice you; second of all, there are too many independent actions flowing into too many different directions.
To capture groups spontaneously, I think we all need to understand the group dynamics. I don't necessarily mean the physics but the actual movement and energy flowing among the members of the group. You have to feel all of the people. You have to watch them and you need to be able to isolate each of them in your mind. Then you need to either step far away or you need to step in. Either watch the movement or join the flow, feel the vibe. Once you mature in that flow, once you feel comfortable, then you should start releasing your shutter as much as you want.
Of course feeling the vibe is not all to capture the greatest moment. Altough it depends on your composition, I can suggest using a wide angle lens such as 17-24 mm if you are close to the group. If you stand far, you can get a zoom lens such as 70-200 mm, 28-90 mm based on your distance. I urge you not to use flash and try to get a top line lens with apertures reaching to 2.8, 1.4 and less. Also you can safely use a low aperture (1.4, 1.2) 50mm lens in situations where dancing people and rapidly changing light conditions such as clubbing venues etc. are involved.
Oh and one last notice... Don't mix this with photographing crowds; groups are small number of people acting together like tourists crawling a historic site, or a sports team, or friends etc.