A method of forming the thin film for the gap fill is provided to apply the control gas like the SixHx gas in plural times of etching processes and to suppress the clipping phenomenon of the upper region of gap. The semiconductor substrate is located in the reaction space. The gap is formed in the semiconductor substrate. The plasma is generated in the reaction space. Deposition and etching process are successively progressed by the multiple times to bury gap is. The deposition gas activated by the plasma is used in the deposition. The etching gas activated by the plasma is used for the etching process. The control gas and the etching gas are provided at least one time in the plural times of etching processes.