What does the word "Ārya" really mean in the context of Hinduism?
And which Hindu scriptures use this word and in what sense?
If you think the question is too broad, limit your answer to The Vedas, Vālmīki Rāmāyaṇa and Mahābhārata.
The word Arya is used in Vasistha Dharma Sutras as follows:
The country of the Âryas (Âryâvarta) lies to the east of the region where (the river Sarasvatî) disappears, to the west of the Black-forest, to the north of the Pâripâtra (mountains), to the south of the Himâlaya. 8
(According to others it lies to the south of the Himâlaya) and to the north of the Vindhya range (being limited east and west by the two oceans). 9
Acts productive of spiritual merit, and customs which (are approved of) in that country, must be everywhere acknowledged (as authoritative);
But not different ones, (i.e. those) of (countries where) laws opposed (to those of Âryâvarta prevail).
Some (declare the country of the Âryas to be situated) between the (rivers) Gaṅgâ and Yamunâ.
(Vasistha Dharmasutras,Chapter 1)
Manu Smriti also uses the word Arya or Aryan many a times.This text uses such words to mean a twice-born who has received his sacraments and who is also performing his duties without failure.
2.21. That (country) which (lies) between the Himavat and the Vindhya (mountains) to the east of Prayaga and to the west of Vinasana (the place where the river Sarasvati disappears) is called Madhyadesa (the central region).
2.22. But (the tract) between those two mountains (just mentioned), which (extends) as far as the eastern and the western oceans, the wise call Aryavarta (the country of the Aryans).
2.39. After those (periods men of) these three (castes) who have not received the sacrament at the proper time, become Vratyas (outcasts), excluded from the Savitri (initiation) and despised by the Aryans.
2.103. But he who does not (worship) standing in the morning, nor sitting in the evening, shall be excluded, just like a Sudra, from all the duties and rights of an Aryan
2.165. An Aryan must study the whole Veda together with the Rahasyas, performing at the same time various kinds of austerities and the vows prescribed by the rules (of the Veda).
2.169. According to the injunction of the revealed texts the first birth of an Aryan is from (his natural) mother, the second (happens) on the tying of the girdle of Munga grass, and the third on the initiation to (the performance of) a (Srauta) sacrifice.
I have found more than one references to Arya in the Vedas themselves. Here is one such mantra from Yajur Veda:
YathA imAm vAcham kalyAnim AvadAni janebhyah (1) BrahmarAjanyAbhyAm sudrAya cha AryAya cha (2) SwAya cha aranAya cha (3)
May i speak the sacred word to the masses of the people (janebhya) (1) to the brahmana, kshatriya, to the sudra and the Arya (2) and to our own men and the strangers.
Shukla Yajur Veda 26.2
And, here is another mantra from the Atharva Veda:
Priyam mam krinu deveshu piyam rAjashu mA krinu piyam sarvasya pashyat uta sudra utArye.
Make me dear to everyone (to Gods, Kshatriyas etc) and both to sudra and an AryA.
Atharva Veda 19.62.1
In these mantras the word Arya simply means a noble one. Also note that, in the first mantra Brahmin, Kshatriya and Arya are all mentioned separately.
So, it implies that it is not necessary for an Arya to belong to a particular caste (varna) like Brahmin or Kshatriya.