One way to remember the difference is to recall that parental reprimand: "Hey is for horses". Hay is an animal feed. It usually refers to grass family plants: ryegrass, timothy, or fescue. However, it can also include legumes such as alfalfa or clover. Hay is cut and stored by farmers to feed their animals when grazing on pasture is limited or unavailable.
Straw, on the other hand, is made up of only the stalks of grain plants, typically wheat, oat or barley. These stalks are what's left once the seed head is removed for consumption. Straw is used for animal bedding, and in our case, for mulching our garden beds and adding to the compost pile. Our compost is largely made up of horse manure and straw.
As you can see in the photo, we're using straw bale raised beds. These beds seem to last about two years before the bales sag too much to provide stability. Straw bale beds are cheap to make (straw bales cost $7-$9 each at feed supply stores, or, can often be found for free around town - especially after Halloween).
We use six bales tied together to make a rectangular shaped bed. The straw does a nice job holding and imparting moisture to the bed as well. Once the straw bales are too saggy to support the dirt, we take apart the structure, use the straw in our compost, and save the soil for the next straw bale bed.
The funny thing about this photo is that clearly this bale wasn't 100% straw. There were seed heads left behind on the field and then baled in with the straw. Once the rain came, those seed heads sprouted. I notice the same phenomenon when I lay down fresh straw for our chickens at home. They scratch through it looking for those furtive, nutritious kernels.