I probably would wash it first with water and detergent powder thoroughly to remove the dirt and sand from the bike. Then, I would let it dry for a while in the sun after the rain has passed. And finally, I would lubricate the parts like the derailleur, gears, sprockets, etc. to keep the bike corrosion free and running smoothly.
After I ride in the rain, you should probably wipe down the bike and bring it inside. If there is no time for that, then just place it in your garage under some cover. NEVER EVER let it sit out in the rain, then dry. This is one mistake my son made when he got his first bike. Rust builds quickly.
Yes, I've done that in the past and I regret it because after that the bike started to make all sort of funny noises. Sure, the bike endures rain, but it's not suppose to sit there and dry, all the fluids go away.
I have undercover parking at home, so it gives in a chance to dry out. Fortunately my chain is covered so it stays lubed pretty well even if it rains. I think the most important thing is just to make sure you everything stays lubed up. The grease will prevent rust from being able to form on any of the parts.
I'll lubricate the chain a little bit and then wipe the bike down after a rain ride. I don't do much more than that, but I didn't spend a ton of money on my current bike, so it's not a huge worry. I know people that religiously treat their bikes after riding in the rain. I don't judge them for it. I don't have the time for that much care, though.
If people have a big investment on the bike and the space (and time) to work on it, great, I envy them and I hope I could do the same. The bike needs to be well taken care of or else it will give us trouble.
I think it's huge to get your bike dried after being in the rain. I try to dry as much as possible with a cloth and then I use an air hose to blow out the nooks and crannies. I will usually do a complete chain cleaning and then relubing. Lubing a dirty chain is just not good. The key for me is to try and stay out of the rain!
I cycle a lot in the rain (we get a lot of rain in the UK) and have to wash and wipe my bike down every ride to clean off any muck & dirt or in winter salt from the roads, then clean the chain and oil it. The bike is then stored under a cover outside because we don't have a garage or anywhere else to store the bikes, so drying it off is almost as important as making sure the chain is cleaned and oiled appropriately. With the appropriate care (like getting salt off the bike and cleaning/oiling the chain as needed) none of the bikes have had any issues or rusted.
I'd just wipe it off with a cloth and let it dry. Maybe a sprinkle or two of oil just to keep everything nice and sound. Nothing much you can do about that unless you want to have a huge bath for it like every time it rains.