ASP.NET provides an easy way to write custom http handlers. You simply implement the IHttpHandler interface and register your handler in the "web.config" section under system.web like this:
<httpHandlers>
<add verb="*" path="*.my_extension" type="MyHanlders.Handler, MyHandlers" />
</httpHandlers>
This registers a class named Handler to handle requests to URLs with extension ".my_extension".
You still need to let the web server know about this extension, and configure it to pass processing of files with this extension to ASP.NET.
To do it in IIS7, add the following to your web.config, under the "configuration" section:
<system.webServer>
<handlers>
<add name="handler_name" path="*.my_extension" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" />
</handlers>
</system.webServer>