Cosmic ray interactions in the solar atmosphere