The two most abundant elements in the universe are hydrogen and helium with hydrogen making up about 75% and helium about 23% of the matter in the universe.
Chemical elements are created in the stars through a process called thermonuclear fusion. The nuclei of two hydrogen atoms, under extreme heat and pressure, fuse to form helium. This process releases a great deal of energy. The energy produced by the sun comes from thermonuclear fusion.
Larger elements are formed by fusion, for example a hydrogen nucleus which has one proton and a helium nucleus which has two protons can fuse to form a lithium nucleus which has three protons. Successively larger atoms are formed in this way. Stars start as hydrogen and their compositions change as larger elements are produced. One tool that scientists use to estimate the age of a star is the comparison of the relative amounts of hydrogen and helium. Younger stars contain a greater proportion of hydrogen. Elements in a star are detected by analyzing the spectrum of light it produces.