I've been going through several pieces (mostly of Bach, but also others) and I noticed that very commonly, the 7th is sharped when played coming down from the tonic. Examples: Little Fugue, Toccata and Fugue (both Bach), La Folia (Vivaldi), and Grieg's Piano Concerto in A minor. Why?
It should be noted as well that the #7 leading tone is the maj. 3rd of the V7 of the current key if it was major (e.g. "modal mixture" - we're using the dominant V or V7 of I instead of the diatonic v of i, using the V of one key and the i of the other, not "relative"); as noted above the "leading tone", but then, chromatic approach tones from both above (tri-tone sub) & below (the leading tone) always work as approach tones for any key/note in reality... appoggiaturas, chromatic passing tones, and of course the leading tone is the strongest of them all... it's the reason why V goes to I (or i in the case of a minor key), the maj. 3rd of the dominant always resolves upwards to the root of the key, the minor 7th of the dominant V7 always resolves down a step to the maj 3rd of I (if you've added the 7th of course that is, it's not as strong a movement in the minor key because the gap increases to a whole step instead of a half step when you flat the 3rd in the i chord). It's the very essence of functional harmony from Bach onwards. When you begin seeing these chromatic resolutions elsewhere in the key, they are generally an indication of some form of secondary dominant function on a "micro" level, although they can also be analyzed in a variety of ways depending on context.
A nice way to really take advantage of the leading tone sound is to alternate between the diminished arpeggio built off the #7 leading tone (and the resultant symmetrical inversions) and the straight minor (Aeolian) tonality; play the dim. sound over the V/V7 sound, and then resolve it chromatically back to the minor i tonality (i.e. F# dim arp. resolving to Gmin), it sounds more "harmonic minorish" [sic] than harmonic minor does. I tend to think I hear it a lot in Afro-Cuban music in a minor key as well... sometimes I just sit around for hours switching back and forth bar for bar playing with the resolving tonalities (V7 to i) over and over (kind of like playing the end of the Toccata into the Fugue section over and over again); there are some other cool tricks involving a couple modes of melodic minor for ii7b5 V7alt to i as well, but they're beyond the scope of this question, but really aren't… as the leading tone really is the essence of functional "western" harmony. (there is no I without V, no good without bad, no light without dark, etc…)
I suppose my above answer is a bit off the mark, as the question was referring to a "descending" maj7th from the tonic (the opposite of a functioning "leading" tone (e.g. leading to the "tonic"); if it's a melodic descent (going lower in pitch), it isn't a leading tone as it's not resolving upwards to a tonic... This short quote from the above wiki link is probably the most relevant section...
"While it evolved primarily as a basis for chords, the harmonic minor with its augmented second is sometimes used melodically. Instances can be found in Mozart, and notably in Schubert (for example, in movement 1 of String Quartet 14, "Death and the Maiden"). In this role it is used descending far more commonly than ascending."
So... I would look through the rest of the notes in the areas in question, and ask yourself what the underlying tonality is, what's going on in the chordal structure when the composer has chosen to descend by means of a raised 7th from the tonic, maybe he's over the V chord but resolving to the tonic in a different voice? Maybe it's just to add color to the line over a i chord, we'd really need to see the score to determine for certain, otherwise we're just kind of guessing without knowing the full context, this isn't happening in a vacuum (literally… if a tree falls in a vacuum???)
You may want to read this Wikipedia article section, concerning harmonic minor. Short summarized, this variant of minor keys reduces the gap between 7th and octave, so that the seventh tone can be used as a leading tone similarly as in major keys.