It's important to note that this prefix is a little tricky because it's not always pronounced the same way as the letter "a" by itself. In "astray," the "a-" is pronounced like the "a" in "away."
The prefix "a-" can have various meanings, but in this case, it indicates "away from" or "out of."