A The Big Bang

The current theory for the origin of the Universe, the Big Bang, is very successful in describing the observed Universe today. The four key observational successes of the standard Hot Big Bang model are the following:
Origin of the cosmic background radiation
Nucleosynthesis of the light elements
Formation of galaxies and large-scale structure
Here we will concentrate our attention in the Nucleosynthesis of the light elements.
The extremely high temperatures of the early moments of the universe did not allow nuclei to exist. At these temperatures, quarks had too much energy to be confined in protons and neutrons. (The Nuclear Wall Chart has details on the phases of nuclear matter.). At about 1 second after the big bang the temperature fell to 100 billion degrees Kelvin and the synthesis of light elements begun. Since the cool down of the universe was very rapid, there was not enough time for the synthesis of heavier elements.
From observation of spectra of the interstellar medium, astronomers have determined the abundance of most common elements in the universe. The 2 most abundant elements in the universe are hydrogen and helium. Hydrogen is about 73% of all the visible mass in the universe. Helium accounts for about 25%. This account leaves only 2% of the visible mass of the universe to all other elements, including C, O, Ca and other elements that are found in living organisms. This "imbalance" is evidence that heavier elements were not formed in the Big Bang.
The web page maintained by the Isotopes Project group at the Lawrence Berkeley Laboratory, has information on the elemental composition of the Solar System and the Earth. The graph below shows the relative abundance of the elements in the solar system.
Learn more about the Big Bang on the Cosmic
Mystery Tour

So where were they formed? and how?
Stars form in nebulae and clouds. About 90% of the material in the Milky Way is contained in the stars, whereas the remaining 10% is distributed among the stars in the form of gas (interstellar gas) and, in lesser degree, in the form of small interstellar dust particles. The major part of interstellar gas exists in the form of neutral material, basically atomic and molecular hydrogen. Spectroscopic observations at centimeter and millimeter wavelengths have allowed astronomers to determine that the major part of interstellar material is concentrated in giant molecular clouds with a mass ranging between ten thousand and one million times the mass of the Sun. This fact makes them the most massive objects in the galaxy.
Observations of interstellar molecules have revealed that the major
part of the gas in these clouds is extremely cold, with temperatures ranging
between
-268 and -253 degrees Celsius and with average densities of a few hundreds
of molecules every cubic centimeter. However, there exist small areas in
these
clouds where the densities are thousands of times higher than the average,
up to 10^7 molecules every cubic centimeter. One of the most important
aspects
in the study of molecular clouds is the fact that it is in the most
dense condensations of these clouds where new stars are born. In the case
of the Milky
Way this takes place at a rate of 4-5 suns per year, approximately.
Due to the high visual extinction associated with these condensations,
the physical processes involved in the star formation take place in extremely
dark
regions and, therefore, are only accessible by means of observations
in the far infrared and at radio wavelengths -- from submillimeter to centimeter
wavelengths --. In the last decade, the observations with large telescopes
and millimeter-wave interferometers have contributed in an important way
to the
understanding of the first stages of star formation and evolution,
one of the most important and yet unresolved questions in today's Astrophysics.

This image, taken by the Hubble Space Telescope, shows gaseous pillars in a star-formation region of the Eagle Nebula (also known as M16, or Messier 16). Within the pillars are denser regions dubbed "Evaporating Gaseous Globules" (EGGs) containing embryonic stars. For further details, read the complete caption. Visit the Hubble server for more images of this phenomenon.
This is a schematic view of the process of star formation, obtained from Prof. Alyssa Goodman. Check out her talk on Star formation.
2 - Origin of stellar energy and the elements
A - Energy production and Stellar classes
The initially uniform distribution of matter from the Big Bang somehow was broken to form the clumps that were the proto galaxies. Inside these galaxies, other clumps began to collapse under gravity into smaller bodies. The compression of this collapse heated the gas until it began to radiate light into the universe. These new stars continued to collapse and heat up. After perhaps 10 or 100 million years of this steady collapse, the internal temperature of the new star reached a value of about 10 million degrees (proton energies of about 1 keV), and thermonuclear reactions between the protons in the gas began.
Nuclear fusion reactions are now accepted to be the source of energy in the starts. Until recently this fact was based on circumstantial evidence only. This is because the light we observe from stars is emitted in their surface, and we cannot look inside them to determine what is going on. One of the early evidences that nuclear reactions occur in stars was the observation of spectral lines of an element called technetium on the surfaces of certain old stars. Technetium has no stable isotopes, i.e., all technetium decays into other elements. The observed isotope (99-Tc) has a half life of 0.2 million years. This is very short compared to the life of a star. The conclusion is that 99Tc is being "produced" in the star somehow...
The life time of a star and its fate depends on its mass. The reactions that provide new energy to keep the star shining and to keep it from collapsing further depend on the amount of fuel available. For a comparatively small sun, like ours, the burning of hydrogen can last for 10 billion years. We are about 5 billion years into that period at this time. Large stars can go through their entire life cycle and explode in only 10 million years!
A very useful tool to understand the theoretical evolutionary track of stars is the H-R Diagram, named after 2 famous astronomers, Hertzsprung and Russel. The basics of an HR diagram can be found in this page of the University of Oregon.
These are two representations of the HR diagram, where the luminosity
and temperature of a star are plotted. Also you can load the Java
simulator of the evolution of stars in the HR diagram and use these
questions
about stars brightness and temperature relations.
More on stellar evolution can be found at http://mrcohen1.keel.physics.ship.edu/108/evol.htm

B - What makes the Sun shine???
Before we can answer this question, we need some information on the characteristics of the Sun and other important constants:
M = 2x10^33 g (Mass of the Sun in grams)
L = 4x10^33 ergs/s (Luminosity of the Sun)
A = 4.5 x10^9 years (Age of the Sun)
Since life on Earth has existed for some 2x10^9 years, we can assume that the Sun's luminosity has not changed dramatically over its lifetime. thus we can say that the Sun has radiated LxA = 6 x 10^50 ergs or about 3 x10^17ergs/g.
In the beginning of this century we learned that nuclear reactions can produce large amounts of energy. Consider combining 4 nuclei of hydrogen to form on nucleus of helium. He = 4.0026 amu, H=1.0087 amu. Use E=mc2 for the calculation of how much energy is liberated in this process:
4 x 1.0087 amu=4.0348 amu
4.0348 - 4.0026=0.0322 amu.
amu=atomic mass unit. This and other values of physical constants can
be found at the NIST fundamental
constants page. The result is around 30 MeV (MeV stands for mega-electron-volts),
or around 5 pJ (5 pico Joules). Thus the fusion of H into He is an exothermic
reaction due to the conversion of mass into energy. Many interesting facts
about the Sun can be found at The NASA's observatorium
of
Our Sun .
This process does not occur in one step in the Sun. The burning of hydrogen into helium is a 3 step process. A star which is burning hydrogen is in the "Main Sequence" (MS) of the HR diagram. One very important step is the fusion of helium into carbon in stars. The energy generation process in a star is related to the stellar evolution process.
D - Production of elements beyond iron

Again, the production of elements depends on the mass of stars. Low
mass stars will become "white dwarfs". They do not have enough mass i.e.,
gravitational pressure, to compress and heat up the carbon-oxygen core.
High mass stars keep on contracting and burning heavier elements until
iron is formed in their core. The so-called iron group elements, have the
highest known energy per nucleon. What this means is that no further energy
generating nuclear reactions are possible. Still the core of the star will
keep contracting and heating. The details of what happens next are
not clear. What we know is that a supernova explosion occurs. As the core
of the star collapses, the density grows until it becomes possible for
protons to capture electrons and become neutrons.
This "neutronization" process is very fast and a burst of neutrinos
occurs. Eventually the core of the star reaches the density of nuclear
matter, and a complex hydrodynamic bounce occurs releasing matter into
the interstellar medium, leaving behind a neutron star. Again if the mass
of the initial star is big enough, it will continue to collapse and become
a black hole. The Mr.
Galaxy introduction to supernovae is a good reference on the supernovae
phenomenon.
This is a picture from the Hubble Space Telescope of a supernova remnant,
a supernova which exploded in our galaxy in 1987. Read the press
release for more information.
Elements beyond iron are though to be formed by neutron capture in the
so-called S (for slow) and R (for rapid) processes. Although nobody knows
yet for sure, the most likely environment for the production of the heavy
elements (just about everything with a Z higher than 25) is in these explosions.
"Big Bang Nucleosynthesis and the Baryon Density of the Universe",
Craig J. Copi, David N. Schramm and Michael S. Turner; Science vol 267,
13/january 1995 (page 192)
"Stellar Alchemy: The origin of the chemical elements", Eric B. Norman,
Journal of chemical education, Vol 71, pages 813-820, October 1994.
The periodic table of isotopes at Los Alamos National Laboratory http://pearl1.lanl.gov/periodic/
The University of Oregon "Electronic Universe Project" : http://zebu.uoregon.edu/
Interactive HR diagram http://www.clockwerks.com/trei/proj/H-R/
The Cosmic Mystery tour http://www.ncsa.uiuc.edu/Cyberia/Cosmos/CosmicMysteryTour.html