This photo shows a brave USGS geologist (arrows) who has made his way across a field of active pahoehoe to collect a gas sample from one of 3 active spatter vents (v). This type of sampling is dangerous, but it is just about the only way to collect gas samples that have not been greatly contaminated by air.
This is a remote technique for measuring volcanic gases. The device on the tripod is called a COSPEC, which stands for correlation spectrometer. It was originally developed for measuring the pollution coming out of factory smoke stacks. From a distance of a kilometer or so it makes vertical traverses through a volcanic plume that is being blown horizontally by the wind. By comparing the spectrum of natural light shining through clear air and that shining through the plume, it can determine the amount of gas in the plume. Then, after figuring out how far you are from the plume and how fast the wind is blowing you can calculate the volume of gas coming out of the volcano. In this example, researchers from Michigan Tech. University measured an average of almost 170 tons of sulfuric acid produced per day!
These two geologists were not studying gases but they had to wear gas masks anyway. Especially on days when the winds are slight, you need to worry about volcanic gases blowing your way (when the wind is strong the gases get mixed and diluted in the air).