How Stars Shine
Radiation
When stars produce energy, most of it is emitted with light, in a process called radiation. The amount of energy radiated by any physical body depends on the emissivity of the substance and its temperature. For an ideal absorber and emitter, also called a black body, the emissivity is equal to 1. The power emitted in a unit area by means of radiation by such bodies is predicted using the Stefan-Boltzmann law:
P = σT4, where σ is the Stefan-Boltzmann constant, σ = 5.67×10-8 W⋅m-2⋅K-4. T is the surface temperature of the body, in Kelvin. P is the power emitted by the body in a 1 m2 area.
This law does not only apply to stars; it can be used to calculate the power of radiation emitted from any body.
The entire energy emitted by a body in a second is calculated by:
L = A⋅σT4 = A⋅P, where A is the surface area of the object in square metres. For stars, it can be said that they are round, therefore:
L = 4πr2σT4 = 4πr2⋅P, where 4πr2 is the surface area of a sphere, and r is the radius of the star in metres.
The Sun emits L = 3.828×1026 joules of energy every second. In other words, the luminosity of the Sun is 3.828×1026 W.
The radiation we receive
When radiation leaves the star, it goes outwards into space, distributing equally. The further the light travels to an object, the smaller amount of light illuminates a certain area, the less energy is carried to the object.
Flux, which is energy distributed over one square metre at a certain distance from the star per second is calculated by:
F = L 4πd2 , where d is the distance in metres. This is illustrated in the simulation seen below.
Place the pointer into the area of the simulation showing the inner Solar System. The further the pointer (the observer) is from the Sun, the larger the area that light is distributed in, which can be seen by the lower density of the sunrays. The amount of energy received by an observer for a unit area (1 m2) at that distance can be seen at the "Solar Intensity" line.
Interactive Demonstration
For reference, an average kettle uses around 1500 W of power, while the Earth receives around 1361 W of power for every square metre of its surface.
Wien's Displacement Law
The peak wavelength of a star's radiation, λmax, depends on its surface temperature. This explains the differing colours of stars: hotter stars are bluer, and colder stars are redder. This is described by Wien's displacement law:
λmax = b T , where b=2.898×10-3 m⋅K, and T is the absolute temperature of the star (temperature in Kelvins).
An example can be seen below. Vega (α Lyr) is blue-white in colour, as its surface temperature reaches 10000 K. Arcturus (α Boo) is red in colour, as its surface temperature is only around 4300 K.

A photo taken of Vega.

An artistic illustration of Arcturus.
Image credit: PABLO CARLOS BUDASSI/WIKICOMMS/CC BY-SA 4.0