For rice, microwave is the best!
Put a clean damp (wet but not runny) cloth or paper towel on top of your rice in a microwave safe dish and heat it for 2 minutes. Don't put a lid on top of the dish.

For pasta, left over pasta is always gross, no matter how you reheat it. So stick with microwave. If you pasta is not super saucy, same method (with a damp paper towel) would apply to pasta, otherwise, just heat with a lid on.