A container for holding a sample and a system and method for a handheld spectrometer using the container is disclosed. In one embodiment, the container includes a vial with an optical window at the base of the vial. A sample may be placed in the vial. A hollow plunger may be slidably inserted into the vial which seals the gap between the plunger and the walls of the vial. The plunger includes a filter element. When the plunger is inserted into the vial, the sample is forced against the optical window and the filter element vents liquid and/or gas that is in the vial into the hollow plunger. A portable or handheld system for detecting, for example, biothreat agents makes use of the container in order to determine a spectrum of the sample. The optical window of the container is preferably substantially transparent to photons illuminating the sample and to photons produced due to the interaction of the illuminating photons and the sample.