Context: The Sun has recently been predicted to be an extended source of
gamma-ray emission, produced by inverse-Compton (IC) scattering of cosmic-ray
(CR) electrons on the solar radiation field. The emission was predicted to be
extended and a confusing foreground for the diffuse extragalactic background
even at large angular distances from the Sun. The solar disk is also expected
to be a steady gamma-ray source. While these emissions are expected to be
readily detectable in the future by GLAST, the situation for available EGRET
data is more challenging. Aims: The theory of gamma-ray emission from IC
scattering on the solar radiation field by Galactic CR electrons is given in
detail. This is used as the basis for detection and model verification using
EGRET data. Methods: We present a detailed study of the solar emission using
the EGRET database, accounting for the effect of the emission from 3C 279, the
moon, and other sources, which interfere with the solar emission. The analysis
was performed for 2 energy ranges, above 300 MeV and for 100-300 MeV, as well
as for the combination to improve the detection statistics. The technique was
tested on the moon signal, with our results consistent with previous work.
Results: Analyzing the EGRET database, we find evidence of emission from the
solar disk and its halo. The observations are compared with our model for the
extended emission. The spectrum of the solar disk emission and the spectrum of
the extended emission have been obtained. The spectrum of the moon is also
given. Conclusions: The observed intensity distribution and the flux are
consistent with the predicted model of IC gamma-rays from the halo around the
Sun.Comment: Corrected typos, added acknowledgements. A&A in pres