Unknown. However, note that the light from the Two Trees (or a portion of that light, at least) appears more substantial than light as we think of it (emphasis mine):
The one [Tree] had leaves of dark green that beneath were as shining silver, and from each of his countless flowers a dew of silver light was ever falling, and the earth beneath was dappled with the shadow of his fluttering leaves. The other bore leaves of a young green like the new-opened beech; their edges were of glittering gold. Flowers swung upon her branches in clusters of yellow flame, formed each to a glowing horn that spilled a golden rain upon the ground; and from the blossom of that tree there came forth warmth and a great light. Telperion the one was called in Valinor, and Silpion, and Ninquelótë, and many other names; but Laurelin the other was, and Malinalda, and Culúrien, and many names in song beside.
The Silmarillion III Quenta Silmarillion Chapter 1: "Of the Beginning of Days"
There appears to be a liquid component to the light of the Trees, so it's not difficult to imagine Fëanor being able to acquire some.
This liquidity is, narratively, a holdover from the Book of Lost Tales, the earliest incarnation of what would become the Silmarillion. In that book, the Two Trees are described thusly:
Already was the light that [Laurelin] gave wide and fair, but as the Valar gazed it put forth blossoms in exceeding great profusion, so that all its boughs were hidden by long swaying clusters of gold flowers like a myriad hanging lamps of flame, and light spilled from the tips of these and splashed upon the ground with a sweet noise.
Light like liquid silver distilled from [Telperion's] bole and dripped to earth, and it shed a very great illumination about the plain
Light is the sap of these trees and their sap is light!
History of Middle-earth I The Book of Lost Tales Part One Chapter III: "The Coming of the Valar and the Building of Valinor"
The Lost Tales also include a much more detailed description of how Fëanor created the Silmarils, though understand that the canonicity of these early drafts is questionable at best:
Then arose Fëanor of the Noldoli and fared to the Solosimpi1 and begged a great pearl, and he got moreover an urn full of the most luminous phosphor-light gathered of foam in dark places, and with these he came home, and he took all the other gems and did gather their glint by the light of white lamps and silver candles, and he took the sheen of pearls and the faint half-colours of opals, and he [?bathed] them in phosphorescence and the radiant dew of Silpion, and but a single tiny drop of the light of Laurelin did he let fall therein, and giving all those magic lights a body to dwell in of such perfect glass as he alone could make nor even Aulë compass, so great was the slender dexterity of the fingers of Fëanor, he made a jewel
History of Middle-earth I The Book of Lost Tales Part One Chapter V: "The Coming of the Elves and the Making of Kôr"
This passage does beg the question of how Fëanor collected "the sheen of pearls and the half-colors of opals", but at a certain point we just have to throw up our hands and say "magic"2.
1 The Teleri of later mythology
2 TVTropes link, all hope abandon etc.