the easiest way to deal with a rax is to build 2 or more guard towers in your own base that are in target range of the rax (but that dont impead your own gold flow once its down) so that it dies faster and kills any grunts that pop out of it. But you'll also need to make sure they are not towering you as well. If they are, always stay 1 tower ahead and you will always win because they wasted res on a rax and you didnt.
Once you get better, you'll also be able to kill the rax AND do the same thing to them and pressure them at their base and then you'll find that killing the rax at your base becomes MUCH easier since they are busy looking at their base while you are kicking their ass
In a neighbor war vs 2 good players, you'll see that both players pressure the other and at the same time are still able to fend off the other's attack. The result is usually that no one dies right away but both players are significantly slowed. The player slowed the most, usually ends up losing later in the game.
The idea behind the whole pscout neighbor thing is to kill your neighbor if you can, but if not, then the goal is to slow them more than they can slow you. You'll be able to tell what their intentions are by what they build in your town. If they build a rax, then they have no intentions of killing you quickly. Their intentions are to slow your gold flow as soon as possible and slow you as much as they can. Doing this is MUCH easier than trying to kill them quickly with guard towers so many many players will opt to rax you rather than kill you with GT's. Better players will actually do BOTH rax and kill you with GT's, but that requires excellent resource management and is usually only effective if its done by a seasoned player who can assess the situation instantly and know exactly what to do and not do, determine if something has a high probability of success based on the layout of the board, etc.