I recently made a rockwall using the method you described.
I used egg crate as the 'skeleton' for the rockwall and zip ties to secure dryrock to the egg crate. Once I had the dryrock secured to the rockwall I used the spray foam. There are a few different kinds available, but from reading several posts I decided to use the spray on "pond" foam, which I found at Lowes in the garden area (there is a row for pond supplies). I don't remember the brand name of the pond foam, but you can call or check online to see if they have it in stock. When I got mine, I had to check 2 or 3 stores before I found 1 that had it in stock. I believe for my rockwall (roughly 30" x 24") I used 3 cans of the foam. The other kinds of spray foam are used for insulation purposes, like sealing window casings, etc. I think that is called "Great Stuff", however I read that that kind of foam can break down over time from UV exposure, which we get from our lighting.
For adding the sand or crushed coral, you'll want to use a slow drying 2-part epoxy. I got the 2-part epoxy at Hobbytown USA. I think I used 3 2-part kits for my rockwall. I believe I used the 10 or 15 minute epoxy.
I strongly encourage you to use latex gloves when working with both the spray foam & epoxy, as both can be messy to work with.
There are several threads on RC detailing the foam rockwall process.
You can check out how my rockwall looks here, although I didn't document the build process of the rockwall (wish I did):
http://www.reeffrontiers.com/forums/showthread.php?t=48818
If I did it all over again, I would use more dryrock on my rockwall. When I was building it, it seemed that the eggcrate wouldn't be strong enough to support the weight. But after adding the spray foam, the entire wall becomes very solid.
I had a lot of fun designing & buliding the rockwall. I'd certainly do it again next chance I get!
My tank has been set up since Oct, 2009 which isn't very long, but so far the rockwall is working out perfectly.
HTH & good luck!
Rob