Line spectrum is created by transferring excited electron from one energy level to another. Where atom of every molecule has individual electronic configuration and electron numbers. When electrons are exited by electric spark or by another means and transferred to higher energy level, then influence of reaction with atoms of other malecule, adjacent electrons and Nucleus are different.
Line Spectrum is an electromagnetic spectrum consisting of discrete lines, typically feature of excited atoms or molecules. Consequently when excited electron returns to previous energy level, then scattered and colored spectrum is also completely different or unique.