Get random custom posts from a custom post type

You need to include setup_postdata($post); in your foreach line. Here’s some great demo code from the codex, adopted to fit your query:

<ul>
<?php
global $post;
$tmp_post = $post;
$myposts = get_posts( 'post_type=predic&numberposts=4&orderby=rand' );
foreach( $myposts as $post ) : setup_postdata($post); ?>
    <li><a href="https://wordpress.stackexchange.com/questions/74243/<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
<?php $post = $tmp_post; ?>
</ul>

Note that we’re also resetting $post back to the current post, so we don’t break other functionality.