Niantic has added the ability to do raids remotely to Pokémon Go.
To participate in a remote raid, you'll have to be able to see the gym on your map. You can find raids happening close to your location by using the Nearby button. Players will also be able to raid at gyms if they have Pokémon defending that gym, no matter how far away it is. You'll also need a Remote Raid Pass, which is a completely separate item from normal Raid Passes.
A set of three Remote Raid Passes can be bought from the shop for one Coin as of writing this, but each additional pass after that will need to be bought for 100 Coins.
To participate in the raid, simply tap the gym that has an active raid and use your pass. You'll be able to see how many participants there are in the lobby before you join. Just like normal raids, up to 20 players can join a remote raid.
In the future, players who raid remotely will deal reduced damage. For now, though, players will deal full damage, even when raiding remotely.