For example, in case of using gases A and B, gas A is first injected into a chamber and the molecules of gas A are chemically adsorbed to the surface of a substrate, thereby forming an atomic layer of A. The gas A remaining in the chamber is purged using an inert gas such as an argon gas or a nitrogen gas.