Using Blender to investigate the cast of shadows from an object onto a specific point in space
I would like to point out that the blender python has an API for ray_casting objects so you don't have to manually loop over all the faces of the object your self.

http://www.blender.org/api/blender_python_api_2_63_8/bpy.types.Object.html?highlight=object.ray_cast#bpy.types.Object.ray_cast

import bpy
from mathutils import Vector, Matrix

SunObj = bpy.data.objects['Sun']
sun_mx = SunObj.matrix_world

Surface_Object = bpy.data.objects['Test Points']
surface_mx = Surface_Object.matrix_world
for v in Surface_Object.data.vertices:
    v.select = False

#here some simple test objects
test_names = ['Torus', 'Suzanne', 'Cone']
test_objs = [bpy.data.objects[name] for name in test_names]
test_mxs = [ob.matrix_world for ob in test_objs]

#we get the sun location from the world matrix
sun_location = Vector((sun_mx[0][3], sun_mx[1][3], sun_mx[2][3]))

#Test test points are stored in object data
test_points = [surface_mx * v.co for v in Surface_Object.data.vertices]

hits = 0
for ob, mx in zip(test_objs, test_mxs):

    imx = mx.inverted() #ray_cast happens in local space
    for i, pt in enumerate(test_points):
        loc, no, indx = ob.ray_cast(imx * sun_location, imx * pt)

        #simulate shadow with selection of the test vert
        if indx != -1:
            hits += 1
            Surface_Object.data.vertices[i].select = True

print(hits) 


a sample blend
https://www.dropbox.com/s/004eu6aaqxg6zxy/ray_cast_sun.blend?dl=0