I've kept rays, and I've kept them in reefs before. Mainly because it wasn't my choice. When I started a maintenance account, the damage was done and I've since had to work around the previous inhabitants. Here are a few pointers.
1) Almost all rays available to the aquarium trade that are suitable for reef tank temperatures get far too large for all but the largest aquariums. We're talking most of these guys get about 24" across or larger. There are other smaller rays available in the hobby, such as the commonly seen California Round Ray (
Urobatis halleri), but they come from cooler waters and are not suitable for reef temperatures. Though these would be able to live in smaller tanks in the 250g+ range, they would need a tank and inhabitants specifically oriented towards cooler waters of about 72ºF
2) They're predators. Not that this is a problem being a predator, but a lot of the things that you would like to keep in a reef such as dither fish, herbivores, cleanup crew, and ornamental invertebrates are all on the menu of the ray.
3) Aquascaping plays a large role. They will need sand to bury in, and a rather large amount. Probably equal to around 2-4x their maximum adult surface area. Thus, an ideal hunting and sleeping grounds for a stingray 24"x24" would probably be about 48"x48" minimum. Of course, rocks are a key with reefs to give corals something to grow on, but they also pose a large threat to the ray. Because they like to dig, and they are strong enough to push rocks to get to their food such as an injured fish or shrimp, they can cause avalanches that can kill them. In addition, choice of corals can be a tough decision. The underside of a ray is very delicate and soft. The skeletons of lots of LPS and the SPS can easily scrape and cut a ray. These cuts can then become infected. As you can see, a reef tank with a ray in it needs to be very large so the ray and the reef can live happily.
4) Defense and aggression from other fish are likely to complicate the lifestyle of a ray. Because a predator is present, most of your typical reef fish will hide, especially the dither fish. And when the dither fish are hiding, the other fish won't come out as much. For the bolder tank inhabitants, they will actually pick and bite on the predator to try to get it to go away. And since there is no place for the ray to go, they often become very battered. Wrasses, Butterflyfish, and Surgeonfish are notorious for nipping at rays as a defense.
5) Feeding is difficult. If you can get them to eat prepared foods, you've only won half the battle. You can't feed these guys just silversides and krill for their life. You need to be able to feed them a variety of healthy foods, and even supplement with some extra vitamins. Things like scallops, squid, octopus, oysters, raw fish, etc are great and are easily found at most local grocers and Asian food markets.
With that said, if you can sit down and properly plan a reef around a single ray and know that you can take care of a very large tank, then it can be done. In fact, rays in reefs are quite enjoyable. Rays are very charismatic and inquisitive. But with that said, I highly suggest that people do not get rays because of their special needs. Here's the unfortunate one that has survived quite well in a 300g reef (FOwLR to Reef in the works) for the past 8 years.