Surprisingly, LEDs are affected by gravity in more ways than might be initially obvious. Evidently, LEDs as a whole are affected as any other object would be by gravity, but dive a little deeper and gravity has some surprising results.
Photons are widely regarded to have no mass[5,6], which in theory means they could go about their business unaffected by gravity. However, look at a black hole and it is apparent that light definitely is affected by gravity: in a black hole, all radiation and matter are drawn in due to the extreme gravitational force of attraction. This is because Newtonian physics is essentially incorrect – while it works for the physics we see on Earth, some unobservable effects do in fact disprove it. For example, when a laser is aimed at a wall, it appears to travel in a perfectly straight line. But, with a long enough distance it is apparent that there is some magnitude to the horizontal component of its velocity – it’s an exceptionally small magnitude but one that’s there nonetheless. So Newtonian motion is in this case incorrect. Photons have a rest mass of 0, but still they are affected by gravity. According to the equation, F=ma, acceleration, a, is inversely proportional to mass. But if mass is zero, acceleration is infinite, or zero. Therefore, Einstein’s theory of general relativity comes into play.
In general relativity, gravity isn’t a force of attraction as it is in in Newtonian physics. Einstein imagined gravity to be something which affects the structure of space and time within its vicinity. According to Einstein, if something travelling in a ‘straight line’ or at a ‘constant velocity’ entered the field, the very definition of a ‘straight line’ would change. You throw a ball up in the air, it travels in a straight line through spacetime. It’s a strange idea to think about – and it’s easier if you don’t try and visualize it – but it has some important effects for our humble LED. Large pieces of matter create changes for space and time, which means that although quanta of light only travel in a straight line, the photons are affected by gravity. The path of the photon does change – light can bend! But, once again, in very minute amounts. The light isn’t actually bending, but appears to do so because the space in which it is traveling bends. This is why light is sucked into black holes. The light maintains a straight path but because the singularity has infinite density, space time is infinitely curved around it. Light that has crossed the event horizon will begin to spiral inwards and inwards until it is sucked into the black hole. Gravity also distorts time as well as space. Because of this, the speed of light drastically reduces until it is zero – which means it cannot escape the black hole. 
There’s another factor at play too – redshift and blueshift happen as an object is moving toward or away from something or someone, and it happens as photons are accelerated toward Earth too. Gravitational redshift as the phenomenon is known means that if light is observed by someone with higher gravitational potential than the source of the light, it has a comparably shorter wavelength than that if it were to be observed by someone with a lower gravitational potential – the light is redshifted. The Harvard Tower experiment showed that this existed – Harvard scientists Pound, Rekba and Snyder conducted an experiment in the 1960s using a 22.6m tall tower and 14.4keV gamma radiation source. They calculated the change in wavelength to be very close to that predicted – a factor of 4.92×10-15. For LEDs this means that if a green LED was placed 100m above the observer the light would be shifted toward the blue end of the spectrum, and vice versa. This is essentially the Doppler effect in action. However, photons do not create so-called gravitational wells themselves, which means they do not cause any interactions with other photons.
Of course, photons aren’t the only minute particle in an LED, there are electrons which cause the semiconductor to create light. Electrons do have a mass – 9.1×10-31kg. This means that whilst it is to an exceptionally small degree, electrons do in fact feel the effect of gravity. From calculation with Newtonian physics, we can deduce that the force due to gravity experienced by a single electron is just 8.93×10-30N. To continue the calculation, the average current in an LED is 20mA or 0.02A. Per second, there is therefore 0.02C of charge passing through an LED. This equates to 1.25×1017 electrons every second, meaning there is a total gravitational force of 1.12×10-12 on all the electrons in a single LED. Although it would initially seem that pulling electric charge in a field would be more difficult than it were not in a field, in practice this is negligible as the gravitational force is so weak when compared with the electromagnetic force. 
To conclude, LEDs are affected by gravity in a number of ways. From Einstein’s general theory of relativity, which causes the paths of photons to change as the very geometry upon which Newtonian physics is based is changed, to the change in wavelength of emitted light as the observer has a different gravitational potential to that of the emitter, to the effect of gravity upon the electron- from examining this one component, a whole host of problems and solutions arise.