In Gaelic the name is Mairi (not sure whether there should be an accent in there somewhere), but when adressing someone whose name is Mairi you should say "a Mhairi" (uh Vah-ree). This is known as the "vocative case".
Similarly in the song "Fear a Bha\ta" the boatman is addressed as "Fhir a bha\ta" in the chorus.