This article is a summary of 6 lectures given at the Summer School & Workshop Solar Magnetic Phenomena at Kanzelhohe Solar Observatory, 25th August to 5th September 2003. It addresses observations and theory of high energy radiation from the sun; with the emphasis almost entirely on hard X-rays (HXR) from flares but with brief mention of gamma-rays and of nonthermal processes in the non-flaring sun. Following an outline of hard X-ray instrumentation, some relevant plasma properties are briefly discussed, and the importance of HXR data to flare theory explained. There then follows a more detailed discussion of HXR source theory and data interpretation. The discussion is oriented toward the fact that since February 2002 data have been on stream from the RHESSI Mission providing high resolution HXR (and gamma-ray) imaging spectrometry for the first time by combining Ge detectors with rotating modulation collimators. Volume integrated source spectra are first discussed under the headings: bremsstrahlung cross-sections Q(epsilon, E), total photon spectrum J(epsilon) and mean source ('thin target') electron spectrum, (F) over bar (E), for homogeneous and inhomogeneous sources, J(epsilon) for various parametric (F) over bar (E) and Q(epsilon, E), inversion of J(epsilon) to find F(E) and dependence on Q(epsilon, E), sensitivity of (F) over bar (E) to noise in J(epsilon). Next, large scale issues of electron beam propagation are discussed including: - HXR source spatial structure, - transport effects and the collisional thick target model injection spectrum. F-0(E-0), including sensitivity to J(epsilon), beam electrodynamics, beam heating of the flare plasma, including chromospheric evaporation and Neupert Effect. micro-events. Finally; a short list of RHESSI discovery highlights is presented.