The Sun is the most energetic natural particle accelerator in the solar system, producing ions up to many GeV energies and electrons up to ~100s of MeV in both large solar flares and fast coronal mass ejections (CMEs). Large solar flares are the most powerful explosions in the solar system, releasing up to ~1032-33 ergs in 100-1000 s, with >~10-50% of this energy going to accelerating electrons to >~20 keV and a comparable amount to accelerating ions above several MeV energy. Imaging of the hard X-ray (HXR)/gamma-ray continuum and gamma-ray line emission produced by the accelerated electrons and ions, respectively, by the RHESSI (Ramaty High Resolution Solar Spectroscopic Imager) spacecraft, shows that the process of magnetic reconnection underlies both the flare energy release and the acceleration of electrons and ions. Fast (>~103 km/s) CMEs drive shock waves that appear to accelerate the Solar Energetic Particles (SEPs) at altitudes of ~2-40 Rsun, with up to ~10% of the total CME kinetic energy going to the accelerated ions. Observations from RHESSI confirm that the flares associated with SEP events all have hard X-ray bursts with a unique soft-hard-harder spectral evolution with time. The relationship between the CME and these flare hard X-ray sources in the chromosphere is presently not understood.