How does a combat aircraft handle the recoil force of a mounted gun?
In case of combat aircraft, the guns are hard mounted on the fuselage (or wings, for that matter) so that the recoil force is distributed throughout the body. In this case, the large aircraft mass acts to reduce the effects, though if the gun has too much recoil, it can cause damage to the aircraft. For example,


  The MiG-27's GSh-6-30 cannon didn't prove particularly useful in practice. It was an impressive weapon in principle, ..., but the recoil -- about 5.5 tonnes (6.05 tons) -- still had a tendency to inflict damage on the aircraft. ... Landing lights almost always broke after firing,


In case of smaller aircraft or drones, you can chose a gun with lesser recoil. Or the drone (for example) could be programmed to fly back to its original position as a way of 'absorbing' the recoil.

Another way is to mount the gun on stabilization platform, which makes sense only if the gun is quite small. A few such systems exist, which usually use robotic stabilizers to reduce the effects of the recoil due to the gun.