Under the Cycles Render, I inserted a pyramid with the emission material attached to it and it is inside the octagonal shape glass. When I am rendering the scene, the pyramid weirdly is being displayed as seen in the image and this appears to be happening on the edges of the shape. How do I fix this?
The problem you are having is that if you set no thickness to the glass then your object becomes a solid piece of glass:
If you give the glass some thickness (in this example I used a solidify modifier) then it will behave like an object that has glass panes, but is empty inside.
But the problem is not solved, because the default glass shader has problems dealing with direct light going through it.
Using the tricky glass shader detailed in this post: How to illuminate the darkness inside glass objects in Cycles? will give you more realistic results.