In summary, per Tolkien's own words from Letter 155, magic (or spells) is largely about motives and intentions. In general, with some exceptions, magic is an inherent power (in beings like Elves/Eldar, Wizards/Istari, Dwarves/Khazâd etc.) that can't be acquired or learned through lore or spells and it is not possessed or attainable by Men (Hobbits probably included). The two exceptions Tolkien noted were Aragorn as a healer (but he is not a "pure Man") and the Númenóreans, a gifted race of men, used spells in making swords and alike (Note: Daggers of Westernesse/Barrow-blades, that broke the spell that enabled the Witch-king to move, were wrought by them also). Beorn's shapeshifting ability to change into a bear seems magical also. Men and hobbits, however, could use magical objects made by others.
There are two types of magic called magia and goeteia; and both good and bad side can use them with different motives. There are spells used by beings that can use magic but it is more like a way of channeling the inherent power. In The Hobbit, the Dwarves place spells over the gold in the troll-cave. In The Lord of The Rings, Elrond places a spell on the Ford of Bruinen. When Gandalf first encounters with the Balrog of Moria, he describes a spell as "word of Command".
‘What it was I cannot guess, but I have never felt such a challenge. The counter-spell was terrible. It nearly broke me. For an instant the door left my control and began to open! I had to speak a word of Command. That proved too great a strain. The door burst in pieces. Something dark as a cloud was blocking out all the light inside, and I was thrown backwards down the stairs. All the wall gave way, and the roof of the chamber as well, I think.
A spell is an uttering or a magical incantation used for a purpose but your inherent power or innate ability makes it happen. You can place spells on things or you can use spells for something to happen in that moment. Magic can be used without spells also. There can be different levels of power/magic and spells to channel it. Additionally, the beings with the inherent power can reach to higher levels of mastery. In The Fellowship of the Ring at the Doors of Durin, Gandalf said:
I once knew every spell in all the tongues of Elves or Men or Orcs, that was ever used for such a purpose. I can still remember ten score of them without searching in my mind."
In the stories, the language of most spells appear to be in Quenya and we see spells in Sindarin as well. Here are the details about the spells used in the stories from askmiddlearth.tumblr.com. Note that Frodo is mentioned using a spell but it was for using a magical item. "Hail Eärendil, brightest of stars!" refers to the light of the star of Eärendil, the Silmaril he wore upon his brow.
Elves appear to have more powerful innate magic than many beings (even among elves) and they are strongly connected to nature also. They also have skills and abilities far beyond Men, and can craft magical objects. It might explain why more spells mentioned in the stories are in Elven languages. However, as I mentioned in the answer, Gandalf knew spells in tongues of Elves, Men and Orcs also. He mentioned it for a certain purpose (opening doors) but we can infer that there are many spells in different tongues for many purposes.
Narya (The Ring of Fire) gave Gandalf additional strength and amplified some of his abilities like his innate ability to encourage and persuade others. Fire manipulation ability might be enhanced with Narya also but it was never explicitly explained that the fire manipulation ability was solely from Narya. Gandalf doesn't depend on or need Narya to use his innate power.
For more details and completeness, here is the full text of "Letters of J.R.R. Tolkien - Letter 155 to Naomi Mitchison":
I am afraid I have been far too casual about 'magic' and especially the use of the word; though Galadriel and others show by the criticism of the 'mortal' use of the word, that the thought about it is not altogether casual. But it is a v. large question, and difficult; and a story which, as you so rightly say, is largely about motives (choice, temptations etc.) and the intentions for using whatever is found in the world, could hardly be burdened with a pseudo-philosophic disquisition! I do not intend to involve myself in any debate whether 'magic' in any sense is real or really possible in the world. But I suppose that, for the purposes of the tale, some would say that there is a latent distinction such as once was called the distinction between magia and goeteia.
Galadriel speaks of the 'deceits of the Enemy'. Well enough, but magia could be, was, held good (per se), and goeteia bad. Neither is, in this tale, good or bad (per se), but only by motive or purpose or use. Both sides use both, but with different motives. The supremely bad motive is (for this tale, since it is specially about it) domination of other 'free' wills. The Enemy's operations are by no means all goetic deceits, but 'magic' that produces real effects in the physical world. But his magia he uses to bulldoze both people and things, and his goeteia to terrify and subjugate. Their magia the Elves and Gandalf use (sparingly): a magia, producing real results (like fire in a wet faggot) for specific beneficent purposes. Their goetic effects are entirely artistic and not intended to deceive: they never deceive Elves (but may deceive or bewilder unaware Men) since the difference is to them as clear as the difference to us between fiction, painting, and sculpture, and 'life'.
Both sides live mainly by 'ordinary' means. The Enemy, or those who have become like him, go in for 'machinery' – with destructive and evil effects — because 'magicians', who have become chiefly concerned to use magia for their own power, would do so (do do so). The basic motive for magia – quite apart from any philosophic consideration of how it would work – is immediacy: speed, reduction of labour, and reduction also to a minimum (or vanishing point) of the gap between the idea or desire and the result or effect. But the magia may not be easy to come by, and at any rate if you have command of abundant slave-labour or machinery (often only the same thing concealed), it may be as quick or quick enough to push mountains over, wreck forests, or build pyramids by such means. Of course another factor then comes in, a moral or pathological one: the tyrants lose sight of objects, become cruel, and like smashing, hurting, and defiling as such. It would no doubt be possible to defend poor Lotho's introduction of more efficient mills; but not of Sharkey and Sandyman's use of them.
Anyway, a difference in the use of 'magic' in this story is that it is not to be come by by 'lore' or spells; but is in an inherent power not possessed or attainable by Men as such. Aragorn's 'healing' might be regarded as 'magical', or at least a blend of magic with pharmacy and 'hypnotic' processes. But it is (in theory) reported by hobbits who have very little notions of philosophy and science; while A. is not a pure 'Man', but at long remove one of the 'children of Lúthien'.
Another exception about Men from Tolkien's later works (which came after he wrote letter 154 and 155 in 1954):
In a later work completed by 1959, the Athrabeth Finrod ah Andreth, there is an amended note which contains the Tale of Adanel in which the strongest and the cruellest of the fallen Men who worshipped Morgoth, during the dawn of Men in Middle-earth, were given "gifts" and "knowledge that they kept secret" which made them "powerful and proud," and with their new power, they enslaved the other Men. In this later text, Men could be given artefacts or taught lore, but magic remained a noninherent trait.