It is caught from contact with someone with the virus. Generally, as far as I can remember, you are infectious before the spots come out and while they are still coming out. Once they have stopped appearing and have started to dry up you should be okay.