I believe this is The Horror of the Heights by Sir Arthur Conan Doyle, first published in The Strand Magazine in November 1913.
The Wikipedia summary is a good match for your description:
The story is told through a blood-stained notebook discovered on the edge of a farm in Withyham. The notebook is written by a Mr. Joyce-Armstrong, and the first two and last pages are missing; the notebook is thus dubbed the "Joyce-Armstrong Fragment".
Joyce-Armstrong, a brave aviator, had been curious over the deaths of certain pilots who tried to break the current height record of 30,000 feet. Recent casualties involve some strange deaths – one, Hay Connor, died after landing while he was still in his plane, while another, Myrtle, was discovered with his head missing. Joyce-Armstrong speculates that the answer to these deaths may be the result of what he calls "air-jungles":
"There are jungles of the upper air […] One of them lies over the Pau-Biarritz district of France. Another is just over my head as I write here in my house in Wiltshire. I rather think there is a third in the Homburg-Wiesbaden district."
Joyce-Armstrong takes his monoplane to a height of 40,000 feet and is nearly hit by three meteors. It is then that he learns that his speculations are right: entire ecosystems (air-jungles) exist high in the atmosphere, and are inhabited by huge, gelatinous, semi-solid creatures. After going through a flock of animals superficially resembling jellyfish and snakes, Joyce-Armstrong is attacked by a more solid-looking but amorphous creature with a beak and tentacles, from which he narrowly escapes. He then returns to the ground.
The aviator writes he will be going up again to the air-jungle to bring back proof of his discoveries, but here the fragment ends, save for one last sentence which reads:
"Forty-three thousand feet. I shall never see earth again. They are beneath me, three of them. God help me; it is a dreadful death to die!"
The narrative outside the notebook then explains that Joyce-Armstrong has been missing and that his monoplane was discovered in a wreck on the border of Kent and Sussex.
And the pilot definitely mentions having and using a shotgun in the story:
“And now it is my plan to go once again before I give my results to the world. My reason for this is that I must surely have something to show by way of proof before I lay such a tale before my fellow-men. It is true that others will soon follow and will confirm what I have said, and yet I should wish to carry conviction from the first. Those lovely iridescent bubbles of the air should not be hard to capture. They drift slowly upon their way, and the swift monoplane could intercept their leisurely course. It is likely enough that they would dissolve in the heavier layers of the atmosphere, and that some small heap of amorphous jelly might be all that I should bring to earth with me. And yet something there would surely be by which I could substantiate my story. Yes, I will go, even if I run a risk by doing so. These purple horrors would not seem to be numerous. It is probable that I shall not see one. If I do I shall dive at once. At the worst there is always the shot-gun and my knowledge of . . .”
You can read the full story here.