How does rabies affect the nervous system?

it inflames it, causing your salivary glands to inflame and overreact which makes you foam at the mouth