The primary excavated surface of a trail upon which the tread or finished surface lies. Also the bottom of a channel, creek, river, stream, or other body of water.
(1) The trail gets built on top of the bed. If you try sleeping there you'll only get buried in dirt, and anyway that (meaning you) will make the trail lumpy.
(2) A bed is what Ed slept in one night, directly before a flash flood took him for a tour of the downstream sights.