Can someone shed light on how particle が is replaced by の

I know this sometimes が can be replaced with の, and as far as I know this happens when a noun is modifying a noun.
Is this all there is to it?
Is it important to always replace が or is it optional?
Can it always be done?
As far as I know, "no" can but doesn't have to replace "ga" in subordinate clauses. Sorry, I don't have a useful keyboard at hand for Japanese text at the moment.
As bertoni says, I think the situation you're referring to is when an entire phrase modifies a noun, and the subject of that phrase is marked with の instead of が.



I think it's mostly a matter of preference and either is acceptable.

In classical Japanese, が and の both had pretty much the same function (が was also used for possessives) and that may have something to do with it. One other theory I've always held, though I don't know if there's any truth to it, is that the subordinate clauses could be broken down two ways and the の conveys that everything after the の is something that "belongs" to the thing before the の:


Thanksgiving Sale: 30% OFF Basic, Premium & Premium PLUS Subscriptions! (Nov 13 - 22)
I've never truly understood clauses to be honest, so just out of curiosity. Is this kind of an example where the two can be switched?


This is probably ungrammatical but I just thought it up on the spot. Is the 金がある・金のある the kind of "subordinate clause?"
Edited: 2012-03-14, 9:36 pm
Yes, I'd say that's correct.
A subordinate clause is just an embedded sentence, in this case, so I agree that the "ga" and "no" are both fine in your example.
From DOBJG's explanation of relative clauses, p. 378:

3. No can also be used to mark the subject in relative clauses, as in (6).

(6) ジョン が/の 食べたステーキ
(the steak that John ate)

No cannot be used in place of ga, however, if the subject of the sentence is followed by a noun, as in (7a). If no is used in this construction, the meaning of the sentence changes, as seen in (7b).

(7) a. トム が フットボールの切符 を あげた女の子
(the girl to whom Tom gave a football ticket)

b. トム の フットボールの切符 を あげた女の子
(the girl to whom (someone) gave Tom's football ticket)
I read before that の puts the emphasis on what follows it, whereas が puts the focus on the subject like it usually does. I suppose in this way it has similarities with the difference between は/が, but it doesn't seem to be anything like as strict.

Sometimes using のsounds quite natural to me because it almost sounds like possessive の, e.g. 彼の言うこと. 彼が言うこと still has 18-million hits on Google though, so I don't think this is anything to worry about too much, as long as you're able to understand it.