A mass spectrometer comprising: an ion source that comprises a first electrode, a second electrode on a downstream side at which a gas including a sample flows, and a dielectric having a sample introducing inlet portion and a sample outlet portion provided between the first electrode and the second electrode, wherein the sample introducing inlet portion is configured to introduce the gas including the sample into a discharge area between the first electrode and the second electrode, and wherein the sample outlet portion is configured to introduce sample ions into a mass spectrometry unit that is configured to analyze an ion discharged from the sample outlet portion and is further configured to generate a flow of the gas including the sample by a pressure difference produced by a vacuum pump installed at the mass spectrometry unit; a power source that is configured to apply an alternating current voltage to either one of the first electrode and the second electrode and to ionize the sample by a discharge generated in the discharge area; a valve upstream of said sample introducing inlet portion; a valve controlling unit that is configured to control a time period of opening or closing the valve, that changes a pressure of the discharge area, wherein the time period of opening the valve is 5 ms through 200 ms; a light irradiating unit that is configured to irradiate the discharge area with light; and a controller that is configured to control a timing of the pressure change by the valve and a timing of changing a quantity of light irradiated by the light irradiating unit, wherein illumination is switched on prior to or simultaneously with the timing of starting the discharge and the pressure is saturated before a voltage is applied by the power source. an ion source that comprises a first electrode, a second electrode on a downstream side at which a gas including a sample flows, and a dielectric having a sample introducing inlet portion and a sample outlet portion provided between the first electrode and the second electrode, wherein the sample introducing inlet portion is configured to introduce the gas including the sample into a discharge area between the first electrode and the second electrode, and wherein the sample outlet portion is configured to introduce sample ions into a mass spectrometry unit that is configured to analyze an ion discharged from the sample outlet portion and is further configured to generate a flow of the gas including the sample by a pressure difference produced by a vacuum pump installed at the mass spectrometry unit; a power source that is configured to apply an alternating current voltage to either one of the first electrode and the second electrode and to ionize the sample by a discharge generated in the discharge area; a valve upstream of said sample introducing inlet portion; a valve controlling unit that is configured to control a time period of opening or closing the valve, that changes a pressure of the discharge area, wherein the time period of opening the valve is 5 ms through 200 ms; a light irradiating unit that is configured to irradiate the discharge area with light; and a controller that is configured to control a timing of the pressure change by the valve and a timing of changing a quantity of light irradiated by the light irradiating unit, wherein illumination is switched on prior to or simultaneously with the timing of starting the discharge and the pressure is saturated before a voltage is applied by the power source.