It is rather unsettling to think that scientific careers are often made by simple luck. For example, eventual Nobel Prize winner Albert Michelson (1852-1931) only got an education thanks to the literal last-minute intervention of none other than the President of the United States, as I’ve blogged about before!
For modern scientists, one of the biggest bits of anxiety is securing funding to undertake research in the first place, as I can personally attest! Funding has been hard to come by in recent years, thanks to government cuts and budget crises. Nevertheless, I don’t think I would be eager to get a career and research support in quite the way that Joseph Fraunhofer (1787-1826) did!

Joseph Fraunhofer, via Wikipedia.
I’ve known about this tale (which we’ll get to) for quite a few years, but I recently decided to track down the earliest version of it I could find. In the end, I draw from two sources: a memoir of Fraunhofer written after his death from the Journal of the Franklin Institute, volume 4 (1829), p. 96, and Karl Kneller, Christianity and the Leaders of Modern Science (B. Herder, 1911). We begin at the beginning of Fraunhofer’s life with a passage from JFI,
Joseph Fraunhofer was born at Straubing, in Bavaria, on the 6th of March, 1787. His occupations in the workshop of his father, prevented him from giving a regular attendance at the public schools. At the early age of eleven, he was deprived of both his parents, and the person to whose charge he was entrusted, destined him for the profession of a turner; but his weak frame being ill suited to such an occupation, he was apprenticed to M. Weichselberger, manufacturer and polisher of glass, at Munich. Being too poor to pay any thing to his master, he was taken on the condition that he should work for him six years without any wages.
Fraunhofer was eager to learn, but lacked any resources to do so. As Kneller recounts,
Some diagrams that he saw on the walls of the Sunday School made him aware of the existence of a science of Geometry. He bought a text-book for a couple of kreutzers, and set to work to master its contents. But everything was against him. His companions ridiculed him; his master did everything he could to stifle this itch for useless learning; others, whose advice he sought, told him that his project was hopeless.
His story is, in many striking ways, reminiscent of Michael Faraday’s troubles as a young man, in which both circumstances and society conspired against him. But things were about to (seemingly) get worse for Fraunhofer; let us return to JFI.
In 1801, in the second year of his apprenticeship, an accidental circumstance gave a new turn to his fortune. Two houses having tumbled down suddenly, Fraunhofer, who lived in one of them, was buried under its ruins; but while others perished, he fortunately occupied a position to which it was considered practicable to open a passage.
Yes, Joseph Fraunhofer was literally buried alive in the rubble of his master’s property. Workers rushed to aid him, though the work was slow-going:
While this excavation was going on, the king, Maximilian, often came to the spot, to encourage the workmen and the young prisoner; and it was not till after a labour of four hours that they were able to extricate him from his perilous situation. His majesty gave directions that his wounds should be carefully attended to, and as soon as he had recovered, he was sent for to the palace to give an account of the peculiarities of his situation during the accident, and of the feelings with which he was actuated. On this occasion his sovereign presented him with eighteen ducats, and promised to befriend him in case of need.
At the time, in fact, Maximilian was known as Maximilian IV and was the Prince-Elector of Bavaria, not the king. In 1806, he would become Maximilian I, King of Bavaria.

Maximilian I, King of Bavaria, in 1822 (via Wikipedia).
The poor fortune of being nearly killed in a collapsing house was, ironically, the best thing that could have happened to Fraunhofer. The additional income allowed him to purchase equipment to pursue scientific investigations.
Mr. Counsellor Utzschneider, afterwards his partner in the great optical establishment at Benedictbauern, took him also under his protection, and occasionally saw him. Fraunhofer, full of joy, showed him the king’s present, and communicated to him his plans, and the way in which he proposed to spend the money. He ordered a machine to be made for polishing glass, and he employed himself on Sundays in grinding and finishing optical lenses. He was, however, often baffled in his schemes, as he had no theoretical and mathematical knowledge. In this situation M. Utzschneider gave him the mathematical treatises of Klemm and Tenger, and pointed out to him several books on optics. Fraunhofer soon saw, that, without some knowledge of pure mathematics, it was difficult to make great progress in optics, and he therefore made them one of the branches of his studies.
“Counsellor Utzschneider” refers to Joseph Utzschneider (1763-1840), a wealthy technician and entrepreneur who founded a number of companies in Bavaria and was actively involved in the development of the country.

Joseph von Utzschneider, via Wikipedia.
Even with his new good fortune and powerful allies, however, Fraunhofer’s troubles weren’t completely over. One big weakness on Fraunhofer’s part was his unwillingness to go to Utszschneider and Maximilian for help, believing they did not want to be bothered. And he was still apprenticed to an unsympathetic master.
When his master saw him occupied with books, he prohibited him from using them, and other persons whom he consulted, did not encourage him to undertake the study of mathematics and optics without assistance, and at a time when he was scarcely able to write. These obstructions, however, served only to redouble the efforts of our author; and though he had no window in his sleeping chamber, and was prohibited from using a light, yet he acquired a considerable knowledge of mathematics and optics, and endeavoured to apply them to his own schemes.
In order to obtain more leisure, he employed the remainder of the royal present in buying up the last six months of his apprenticeship; and that he might gain some money for his optical experiments, he engraved visiting cards, without ever having been taught the art of engraving. Unfortunately, however, the war which then desolated Europe, put an end to the sale of his cards, and left him in greater exigencies than before.
The war that “desolated Europe” was none other than the Napoleonic Wars (1803-1815). Napoleon influenced science in many ways, direct and indirect, and not often for the better; I’ve written before about how his invasion of Spain nearly got François Arago killed!
The mysterious Utzschneider eventually came to Fraunhofer’s rescue in 1806, bringing him to work in the Optical Institute he co-founded in the former Benediktbeuern Abbey, an institute dedicated to the development of high quality optical elements and instruments.

Benediktbeuren Abbey today, via Wikipedia.
By 1809, Fraunhofer had performed so well that he had taken over the major operations of the Institute, and by 1814 he was a made a partner in the firm.
Fraunhofer demonstrated a real talent on the engineering side of optics, and it served him well in scientific investigation. He put his skills to work in the invention of the spectroscope, allowing the most detailed studies of the emission and absorption spectra of matter of his time.

Fraunhofer demonstrates the spectroscope. Taken from Wimmer’s Essays in Astronomy (1900), via Wikipedia.
In 1814, while analyzing the spectrum of light emitted from the Sun, Fraunhofer noted a number of strange dark lines in what was otherwise a continuous spectrum. These lines had been observed earlier by William Hyde Wollaston in 1802, but Fraunhofer independently discovered them and made a very systematic study of their nature. Fraunhofer’s original, and beautiful, sketch of this spectrum is shown below.
The upper curve shows the relative brightness, or intensity, of the various colors from the Sun; as you might expect, yellow is most intense. In the color image below, however, Fraunhofer noted the various dark lines that practically jump out at the viewer from the image; these are now known as Fraunhofer lines.
We now know that Fraunhofer was seeing some of the earliest direct evidence for the quantum nature of matter. Isolated atoms only emit and absorb light at distinct, isolated, frequencies, and the dark lines Fraunhofer observed are the result of light created in the Sun being reabsorbed by gas in the photosphere surrounding it.
It would take another century for this effect to be satisfactorily understood, but it all began with Fraunhofer. And Fraunhofer himself would not have done any of this work had a building not collapsed on top of him, earning him sympathy and resources.
I am honestly not personally willing to go that far for research funding!

An illustration of the rescue of Fraunhofer, apparently drawn in 1852.