What is a Star?
A Star is a massive ball of gas which has contracted under gravity and begun the process of nuclear fusion.
Life of a Star
When a protostar is formed from the collapse of a giant molecular cloud of gas and dust in the local interstellar medium energy is generated through gravitational contraction. Upon reaching a critical density, energy generation is begun at the core using an exothermic nuclear fusion process that converts hydrogen into helium.
Further Reading: Birth of a star
Once on the main sequence, a star will live for many billions of years in a stable state. In this state the expansion due to heat production in the nuclear reaction is enough to equalise the contraction caused by gravity (hydrostatic equilibrium).
Further Reading: Main sequence stars
Eventually all the hydrogen will have been used and the stars fuel will disappear. When this happens the star begins to cool and contract. As it contracts, its density increases and the star will collapse under the force of its own weight. If it is a small star, it collapses gently and remains collapsed and forms a white dwarf. Large stars will generate a violent explosion, blowing the innards of the star out into space. These will form neutron stars or black holes.
Further Reading: Death of a star
Like the Earth, stars are made from many layers, each having its own distinctive properties.
The central core of a star is where the energy from nuclear fusion is generated. Because of the enormous amount of gravity compression from all of the layers above it, the core is very hot and dense; nuclear fusion requires extremely high temperatures and densities. The Sun's core is about 16 million K and has a density around 160 times the density of water; 20 times denser than iron.
The radiative zone is where the energy is transported from the super hot interior to the colder outer layers by photons.
At cooler temperatures, more ions are able to block the outward flow of photon radiation more effectively, so nature kicks in convection to help the transport of energy from the very hot interior to the cold space. This part of the Sun just below the surface is called the convection zone.
The deepest visible layer of a star is the photosphere (light sphere). It forms the visible surface of the a Star and is generally the coolest part. Our Sun has a surface temperature of only 5840 K compared with the 16 million K of the core. Sunspots are visible on the photosphere.
Moving away from the surface, a star also has an "atmosphere" consisting of the chromosphere and corona. The chromosphere has a low density and emission lines of hydrogen are visible in this region. Its temperature rises the further away from the photosphere you travel.
Finally the upper atmosphere of a star is called the corona. It has a very high temperature, but despite this it has a low amount of heat because it is so tenuous (thin). Prominences are bright clouds of gas forming above the sunspots that follow the magnetic field line loops through the corona.