X-Ray Emissions from Solar Flares and from Celestial Sources