Baking soda. Put some baking soda down on the stain and it should soak up the smell. Leave it for a few hours or even overnight then vacuum it up. It will remove the ammonia smell and hopefully the dog won't want to go there again. If its an old stain or its dried it might not be as effective though. Baking soda and white vinegar is also effective, but spot test first, and always dab, never scrub or it will ruin the pile - particularly if you have berber.

In regards to the dog's behaviour, she might be experiencing some incontinence if its a sudden change, so a trip to the vet is definitely worth it, just to make sure there aren't any kidney or bladder issues going on, particularly since she's still quite young. Of course, if its been really wet lately it could be a response to environment.