Topic, theme, and subject: は (wa) and が (ga)
The distinction between the so-called topic (は wa) and subject (が ga) particles is not straightforward, and in fact has been the theme of many doctoral dissertations and scholarly disputes. The reader is warned to take the material in this section, more than any other part of this article, as a poor and approximate guide. Interested readers are referred to two major scholarly surveys of Japanese linguistics in English, (Shibatani 1990) and (Kuno 1973). To simplify matters, the referrents of wa and ga will be called the topic and subject respectively, with the understanding that if one or the other is absent, then the grammatical topic and subject may coincide depending on context.
As a first approximation, the difference between wa and ga is a matter of focus: wa gives focus to the action of the sentence, i.e., the verb or adjective, whereas ga gives focus to the subject of the action. However, this description is too abstract; a more useful description must proceed by ennumerating uses of these particles.
The use of wa to introduce a new theme of discourse is directly linked to the notion of grammatical theme. Opinions differ on the structure of discourse theme, though it seems fairly uncontroversial to imagine a first-in-first-out hierarchy of themes that is threaded through the discourse. Of course, human limitations restrict the scope and depth of themes, and later themes may cause earlier themes to expire. In these sorts of sentences, the steadfast translation into English uses constructs like "speaking of X" or "on the topic of X", though such translations tend to be bulky as they fail to use the thematic mechanisms of English. For lack of a best strategy, many teachers of Japanese drill the "speaking of X" pattern into their students without sufficient warning.
JON wa gakusei de aru.
(On the topic of John), John is a student.
The warning against rote translation cannot be overemphasized. A common linguistic joke is the sentence 僕は鰻だ (boku wa unagi da), which according to the pattern should be translated as "(Speaking of me), I am an eel." Yet, in a restaurant this sentence can reasonably be used to say "I'd like an order of eel", with no intended humor. This is because the sentence should be literally read, "As for me, it is an eel," with "it" referring to the speaker's order. We can clearly see that the topic of the sentence is not its subject! (As a side note, the separation of grammatical topic and subject is sometimes transported by native Japanese speakers to other languages; for example, a Japanese with a shaky grasp of English might say "I am an eel" in a restaurant in an attempt to order eel.)
Related to the role of wa in introducing themes is its use in contrasting the current topic and its aspects from other possible topics and their aspects. The suggestive pattern is "X, but ..." or "as for X, ...".
ame wa futte imasu ga…
It is raining, but…
Because of its contrastive nature, the topic cannot be undefined.
*dareka wa hon o yonde iru.
*Someone is reading the book.
In this situation ga is forced.
In practice, the distinction between thematic and contrastive wa is not that useful. Suffice it to say that there can be at most one thematic wa in a sentence, and it has to be the first wa if one exists, and the remaining was are contrastive. For completeness, the following sentence (due to Kuno) illustrates the difference.
boku ga shitte iru hito wa daremo konakatta.
(1) Of all the people I know, none came.
(2) (People came but), there wasn't any of the people I know.
The first interpretation is the thematic wa, treating "the people I know" (boku ga shitte iru hito) as the theme of the predicate "none came" (dare mo konakatta). That is, if I know A, B, …, Z, then none of the people who came were A, B, …, Z. The second interpretation is the contrastive wa. If the likely attendees were A, B, …, Z, and of them I know P, Q and R, then the sentence says that P, Q and R did not come. The sentence says nothing about A', B', …, Z', all of whom I know, but none of whom were likely to come. The sentence is ambiguous up to this difference. (In practice the first interpretation is the likely one.)
Unlike wa, the subject particle ga nominates its referrent as the sole satisfier of the predicate. This distinction is famously illustrated by the following pair of sentences.
JON wa gakusei desu.
John is a student. (There may be other students among the people we're talking about.)
JON ga gakusei desu.
(Of all the people we are talking about), it is John who is the student.
For stative transitive verbs, ga instead of o is typically used to mark the object, although it is sometimes acceptable to use o.
JON wa FURANSU-go ga dekiru.
John knows French
I'll try and some some other articles and texts I have on it from time to time, too.