First of all, you need to avoid using query_posts. It affects a lot of Wordpress Globals, and alters the Default Loop which - unless this is your specific intention - absolutely needs to be avoided as it can lead to performance issues as well.
Please look into substituting query_posts with WP_Query instead.
Apart from that, you need to reset your postdata, as well as set up your new postdata in the next loop.
Resetting The Query::
<?php
while ( have_posts() ) : the_post();
?>
<li>
<a href="<?php the_permalink(); ?>"><strong><?php the_title(); ?></strong></a>
</li>
<?php endwhile;wp_reset_query(); ?>
Set up:
foreach( $rand_posts as $post ) : setup_postdata($post); ?>
Reset The Postdata:
<?php endforeach;wp_reset_postdata(); ?>
Why does this need to be done?
Anytime you're using one of those handy Wordpress functions prefixed with "the_", that function is referencing the $post Global. query_posts changes that Global (as mentioned above) and if you plan on referencing that Global in a separate Loop, you need to be able to change it again on the fly.
Resetting your queries is just good general practice in making sure that all of your Globals are back to the Wordpress Defaults. But setup_postdata($post_object) is what actually allows us to change that Global to the current object in our custom loop.
The reason why WP_Query is so effective is that resetting the query is no longer essential as the WP_Query Loops are localized to that particular Object, and doesn't modify the Global $wp_query (which incidentally affects a LOT of other globals).
Here's some handy information about query_posts vs WP_Query that should explain things a little better for you.
Hops this helps.