The atmosphere is never quite neutral due to thunderstorms, which create lightning bolts to rapidly discharge huge amounts of atmospheric charge stored in thunderclouds, and due to ionization from cosmic rays and natural radioactivity. Therefore, in the atmosphere, and in particular in thunderclouds, not negligible electric fields are present. Terrestrial gamma-ray flashes (TGFs) are transient gamma-ray emissions generated by electrons accelerated to relativistic energies in electric fields. The Transient Luminous Events (TLEs) are short-lived electrical-breakdown phenomena which occur well above the altitudes of normal lightning and cumulonimbus clouds. Elves, an example of TLEs, are ultraviolet and optical emissions excited in the lower ionosphere by electromagnetic waves radiated from lightning current pulses. In this talk, we will review the experimental evidence of these phenomena and in particular their study at the Pierre Auger Observatory. Finally, we will discuss the possible effects that atmospheric electricity can have on the detection of cosmic rays.