links ----->
http://www.uoregon.edu/~jrice/geol_311/Cosmochemistry.html
http://www.angelfire.com/on2/daviddarling/elcosmic.htm
Notice that the vertical scale of these charts is logarithmic, so high abundances are really VERY HIGH. Hydrogen and helium dominate, except they escape from Earth's atmosphere into space. When trapped underground, hydrogen readily combines chemically with itself and other elements; helium is generated from radioactive alpha decay, but it is chemically nonreactive, so it can accumulate there.
Notice that there is a precipitous drop at atomic numbers 3-5, then it jumps up for carbon (number 6) and starts a descending curve with atomic number, until the iron group (around atomic number 24-28) springs back. This is the region of maximum normal nuclear stability (cooking with light nuclei). After that, there is a return to the curve, which descends more uniformly (remember, it's logarithmic). These are said to be generated through neutron acquisition in the blast of supernova explosions. There is a rebound down around atomic number 80, relative stability point again.
It is the job of theories of nucleosynthesis to explain these relative abundances on the cosmic scale. It is cosmic nucleosynthesis theory responsibility to explain much of the first 5 elements (according to hot big bang scenario), and it is stellar nucleosynthesis responsibility for explaining the rest.
{CORRECTION replacement statement}
The atomic mass number (total protons and neutrons) is not an unimportant factor.