As with forks, some rear shocks use air pressure as a spring. If your shock doesn’t have a very visible coil spring wrapped round it, it is most likely an air shock.
You can try re-inflating the shock if it is a low pressure, high volume model (where you normally run below 100 PSI pressure). The Schrader valves on shocks tend to be accessible for tire pumps. However, make sure you inflate the correct chamber – some shocks have two or more separate air chambers inside them. Re-inflation won’t help if a seal is broken inside the shock, or on high pressure shocks.
Riding with a deflated shock is unlikely to be damaging to the shock or the bike. Shocks have built-in bottoming-out pads, so ride carefully as you will be riding with the shock pushing constantly against this pad. Check clearance between the rear tire and the frame, and between all the parts of the rear linkage and the frame before you set off.
There is now a pump on the market which has holes through it at the same locations as shock eyelets, so that if your shock won’t re-inflate, you can replace it with the pump. Obviously, given enough time on the side of the trail you could fashion a similar splint from a piece of wood. However, given that the leverage ratio on shocks is often 2:1 or higher, the piece of wood would have to withstand very high compression forces. My experiments using a piece of seasoned oak with perfectly spaced cleanly drilled holes in a well equipped workshop environment suggest that it would work for a short while if you think light thoughts while you ride.