How to identify if a photon comes from the sun? Is there any way to know whether a group of particles is generated from the sun rather from an artificial source?
 A: For a single photon, you can only calculate a probability based on the photon's energy (and polarisation) and the sun's spectrum.
For a group of photons, you can check for properties that are inconsistent with a chaotic (natural) origin. For example, the polarisation pattern of sunlight is well known, and your group of photons can be checked against the expected distribution.
For a group of photons, you can also test for non-classical properties, i.e. for the presence of quantum light. For example, if you detect a group of photons with perfectly equal temporal spacing (i.e. anti-bunching, second order correlation function $g^{(2)}(\tau) \leq 1)$, the light source is likely to be artificial. Various tests exist for coherent light (laser light), and other quantum light properties such as squeezing, Fock states, and entanglement.
A: Photons are identical particles characterized by energy and a direction of propagation.
If you see just a photon, without any other information, from these two properties, you cannot distinguish a solar photon from one coming, let's say, from a tungsten filament at a temperature of $5800\,\mbox{K}$ (the surface temperature of the Sun).
On the other hand, if you see many photons coming from the big glowing spot in the sky, you can reliably tell that they come from the Sun.
A: Imagine a quantum harmonic oscillator. You transfer some energy to the oscillator, so its energy level increases by one quantum. You transfer some more energy to the oscillator and its energy level increases by another quantum. Which quantum is which? How could you even tell?
In quantum field theory, such as quantum electrodynamics, fields are Fourier-decomposed into an infinite sum of harmonic oscillators. When the field receives energy through an interaction, one of these quantum harmonic oscillators gains a unit of energy. When the field in question is the electromagnetic field, we call that unit of energy, that unit excitation a "photon".
These unit excitations have no identity. You cannot tell which one is which. I was inclined to say that when you capture a strong beam of sunlight, chances are most of the photons you capture came from the Sun but even that is not true: it would presume that the photons in question did have an identity in secret. (Perhaps a more apt analogy would be warming a cup of water by a degree then by another degree, and then asking which degree came from where.)
Another relevant example, I think, comes in the form of solar neutrinos. Fusion reactions deep inside the Sun produce electron neutrinos. However, due to neutrino mass mixing, excitations of the neutrino fields that began their existence as electron neutrinos may be captured by a terrestrial detector as muon neutrinos. So where did a specific neutrino come from? The Sun? It didn't even emit muon neutrinos. Somewhere else? No, there are no other sources of neutrinos. Again, the answer is that just like photons, neutrinos have no identity either. What the detector interacts with is the neutrino field in its excited state, not some specific miniature cannonball fired by the Sun.
A: There is no physical difference between the photons emitted by the sun and those emitted by an artificial source, so there is no way you can look at a photon and know for sure what generated it. However, sunlight has specific characteristics which means that you can usually distinguish it from e.g. electric lights.
For instance, you can look at the spectrum (frequencies) of the group of photons and see if they match the spectrum of the sun. This is because any black-body radiates light at different frequencies with specific intensities depending on the temperature of the black-body. The temperature at the surface of the sun is about 6000 K, and so it radiates light with this black-body profile.

There is no physical principle that prevents an artificial source from perfectly emulating sunlight however, and in that case there would be no way to distinguish the two.
